From 5270265d2c1e6da85b0c4c694a655e3b7a0db159 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Tue, 22 May 2012 08:24:21 +0200 Subject: [PATCH] Using foreignalias because there is not RIGHT JOIN Doctrine ORM does not implement the right join (it makes no sense in an ORM) --- config/doctrine/schema.yml | 2 +- lib/model/doctrine/base/BaseGeneralCategory.class.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/doctrine/schema.yml b/config/doctrine/schema.yml index 685b535..9380aba 100644 --- a/config/doctrine/schema.yml +++ b/config/doctrine/schema.yml @@ -137,5 +137,5 @@ UserBasket: class: sfGuardUser local: user_id onDelete: CASCADE - GeneralCategory: { onDelete: CASCADE, local: general_categ_id, foreign: id } + GeneralCategory: { onDelete: CASCADE, local: general_categ_id, foreign: id, foreignAlias: UserBaskets } diff --git a/lib/model/doctrine/base/BaseGeneralCategory.class.php b/lib/model/doctrine/base/BaseGeneralCategory.class.php index 5736d92..8b2ba12 100644 --- a/lib/model/doctrine/base/BaseGeneralCategory.class.php +++ b/lib/model/doctrine/base/BaseGeneralCategory.class.php @@ -7,14 +7,14 @@ * * @property Doctrine_Collection $CompanyCategory * @property Doctrine_Collection $GeneralCategoryDescription - * @property Doctrine_Collection $UserBasket + * @property Doctrine_Collection $UserBaskets * * @method Doctrine_Collection getCompanyCategory() Returns the current record's "CompanyCategory" collection * @method Doctrine_Collection getGeneralCategoryDescription() Returns the current record's "GeneralCategoryDescription" collection - * @method Doctrine_Collection getUserBasket() Returns the current record's "UserBasket" collection + * @method Doctrine_Collection getUserBaskets() Returns the current record's "UserBaskets" collection * @method GeneralCategory setCompanyCategory() Sets the current record's "CompanyCategory" collection * @method GeneralCategory setGeneralCategoryDescription() Sets the current record's "GeneralCategoryDescription" collection - * @method GeneralCategory setUserBasket() Sets the current record's "UserBasket" collection + * @method GeneralCategory setUserBaskets() Sets the current record's "UserBaskets" collection * * @package mobiads * @subpackage model @@ -39,7 +39,7 @@ abstract class BaseGeneralCategory extends sfDoctrineRecord 'local' => 'id', 'foreign' => 'general_categ_id')); - $this->hasMany('UserBasket', array( + $this->hasMany('UserBasket as UserBaskets', array( 'local' => 'id', 'foreign' => 'general_categ_id')); -- 2.1.4