06.22
php
saved
chatmasta
Note
In contrast to my previous paste, when I execute this much more complicated find() operation, ImagetypesLayout does not find its associated Image entry like I want. I know that it recognizes the association because I am not getting the error message "ImagetypesLayout is not associated with model Image."
In contrast to my previous paste, when I execute this much more complicated find() operation, ImagetypesLayout does not find its associated Image entry like I want. I know that it recognizes the association because I am not getting the error message "ImagetypesLayout is not associated with model Image."
- $this->Restaurant->Layout->Imagetype->ImagetypesLayout->bindModel(
- 'className' => 'Image',
- 'joinTable' => 'images_imagetypes_layouts',
- 'foreignKey' => 'imagetypes_layout_id',
- 'associationForeignKey' => 'image_id',
- 'unique' => true,
- 'conditions' => '',
- 'fields' => '',
- 'order' => '',
- 'limit' => '',
- 'offset' => '',
- 'finderQuery' => '',
- 'deleteQuery' => '',
- 'insertQuery' => ''
- )
- )
- ));
- //debug($this->Restaurant->Layout->Imagetype->ImagetypesLayout->find());
- $this->Restaurant->recursive = 5;
- 'Image',
- )
- )
- )
- ),
- 'Restaurant.name' => $this->r_name
- )
- )));
- Produces:
- (
- (
- [id] => 4
- [name] => macruno
- [info] => Mmmm, Macruno fries!
- [layout_id] => 1
- )
- (
- [id] => 1
- [title] => example
- (
- (
- [id] => 1
- (
- [id] => 1
- [imagetype_id] => 1
- [layout_id] => 1
- )
- )
- (
- [id] => 2
- [title] => footer
- (
- [id] => 2
- [imagetype_id] => 2
- [layout_id] => 1
- )
- )
- )
- )
- )
Parsed in 0.131 seconds, using GeSHi 1.0.7.14