I'm having troubles to restrict a find operation based on a related model 
field within a hasAndBelongsToMany relationship.

*// Wedding Model*
*public $hasAndBelongsToMany = array('Guest');*
*
*
*// Guest Model*
*public $hasAndBelongsToMany = array('Wedding');*
*
*
*Then, calling in Guest Controller:*
*
*
*// GuestsController Controller*
*$this->Guest->find('first', array(*
*      'conditions' => array(*
*      **      **'Guest.email' => '[email protected]',*
*      **      **'Wedding.alias' => 'maria-wedding'*
*      **),*
*      **'recursive' => 1*
*);*


*ERROR:*

Column not found: 1054 Unknown column 'Wedding.alias' in 'where clause'

*SQL Query: *SELECT `Guest`.`id`, `Guest`.`created`, `Guest`.`modified`, 
`Guest`.`name`, `Guest`.`email`, `Guest`.`enabled`, `Guest`.`confirmed`

FROM `weddingshare`.`demo_guests` AS `Guest` WHERE `Guest`.`email` = 
'[email protected]' AND `Wedding`.`alias` = 'maria-wedding' LIMIT 1

I understand it is not event joining tables to make the request.

Please, I'd appreciate any help.

Regards

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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


Reply via email to