Hi all,
I am using an alias before I do my find call, because I have a general
search function and I want to parse the results with one chunk of
code, regardless of the Model, so I use:
$this->Model1->alias = 'Result';
This works fine, except for one Model, which contains another. In that
case I am getting an error saying:
Undefined index: Result [CORE/cake/libs/model/behaviors/
containable.php, line 168]
The array $this->settings in the containable.php is storing the
settings against the original Model name, not the alias I have
assigned. Here is my find call:
$this->Model1->bindModel(array('belongsTo' => array(
'Location' =>
array('className' => 'Model2',
'foreignKey' => 'id'))));
$r = $this->Model1->find('all', array('conditions' => $conditions,
'contain' =>
array('Model2')
));
Am I leaving something out here?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---