On Wed, Jun 30, 2010 at 10:15 AM, DragonFlyEye <[email protected]> wrote:
> I'm trying to make an association between two models that do not use
> the primary key as the association. I'm not sure why I'm getting the
> results that I am from this:
> class SubgroupPage extends AppModel {
>        var $name               = 'SubgroupPage';
>        var $useTable   = 'menu_subgroup_pages';
>        var $primaryKey = 'subgroup';
>        var $hasOne     = array('PageSettings' => array('foreignKey' =>
> 'pageid',
>                                                                'conditions' 
> => array('PageSettings.pageid' =>
> 'SubgroupPage.pageid')));
>
Does this work?

var $hasOne = array(
        'PageSettings' => array(
                'foreignKey' => false,
                'conditions' => array(
                        'PageSettings.pageid' => 'SubgroupPage.pageid'
                )
        )
);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to