[horde] Problem in Rdo/RelationshipTest testing clotho example in MySQL
Chuck Hagenbuch
chuck at horde.org
Wed Sep 9 03:58:18 UTC 2009
Quoting Elier Delgado <elier.delgado at gmail.com>:
> Yes, it seem solved, but configuration of relationships must be in
> this way now to example can work.
>
> class ItemMapper extends Clotho_Mapper {
>
> protected $_lazyRelationships = array(
> 'parent' => array('type' => Horde_Rdo::ONE_TO_ONE,
> 'foreignKey' => 'item_parent',
> 'mapper' => 'ItemMapper'),
>
> 'resources' => array('type' => Horde_Rdo::MANY_TO_MANY,
> 'mapper' => 'ResourceMapper',
> 'through' => 'clotho_wbs_resources')
> );
>
>
> class ResourceAvailabilityMapper extends Clotho_Mapper {
>
> protected $_lazyRelationships = array(
> 'resource' => array('type' => Horde_Rdo::MANY_TO_ONE,
> 'foreignKey' => 'resource_id',
> 'mapper' => 'ResourceMapper'),
> );
>
> Somebody can comment when the relationship must be defined in
> "_relationships" or in "_lazyRelationships" ?
The need for putting everything in lazyRelationships was a bug, which
is now fixed (typo). Right now any of the *_TO_ONE relationships can
be either lazy or non-lazy. *_TO_MANY relationships have to be lazy.
-chuck
More information about the horde
mailing list