Hey, first of all, thanks for your guide, helped me alot.

Second, I used your thoughts to solve my problem, which was about paginate and not find itself.

Maybe you might be interested in details about my problem and how I solved it through your solutionm so heres the link with this info:

http://groups.google.com.br/group/cake-php/browse_thread/thread/d6ef718063592fa2#

Best regards,
Kym

Kym on 28/3/09

This is fantastic. Thanks so much for posting this. Not only did this help me accomplish exactly what I needed to do, I understand the (un)bind behaviors much better now.

Mitch

Mitch on 4/9/09

I have been looking for something like this for query that I am working on. While I like the implementation, I think it’s easier just to run a normal SQL query. I still may use it in the future. Thanks.

Les Green on 19/1/10

What about the case when Item HasMany Categories? What manipulations should be done with bind/unbind models?

bancer on 27/3/10

Hi,

This seems like a very useful article. However the table structure mentioned at the beginning is missing…

Sid.

Sid on 28/7/10

Sid: whoops, looks like a I lost a file along the ways. Should be fixed now :)

mark story on 28/7/10

Hi Dude,

I have 4 tables like your exemple. But I have a different associations,

Movies —-< Sessions >—- Rooms >—- Theaters

in your exemple was:

Movies —-< Sessions —-< Rooms —-< Theaters

I m developing a Ticket Store, I have this situation and I can create a query using find() to return all movies which belongs to places

I thing which my modeling is wrong but I cant find other way to represent this situation.
I want to represent the theater sallying, so one Theaters hasMany Rooms and Rooms hasMany Sessions each Session hasOne Movie.

Can you help me?
I want when I use the method find() return to me this struct:

array(

[Theater] => array( id => 1, name => ‘SomeTheater’
),
[Movie] => array( [0] => array( id => 1, title => ‘Shrek 3’ ), [1] => array( id => 1, title => ‘Toy Story’ )
)

)

Alex Medeiros on 5/8/10

Yow mark! keep’em coming, your posts are always good, very logical, and pain relieving :) thanks for the post

asdzxc321654 on 11/9/11

http://github.com/rafaelbandeira3/cakephp-plugins/tree/master/behaviors/linkable.php this link is not working.how can i get the file.

saddam on 15/11/11

Hey,

First off, thanks a mill for this post, it made my problem solving 10x faster, but I am sitting with an unusual problem. Even after removing the bindings and adding them again, the paginator class does not obey them.

For example, I bound a model Vendor to a model Lot, this worked perfectly because I was able to call $data[‘Vendor’] right from the view, telling me it had been associated with no problems.

Yet if I try to filter by Vendor in my paginator:

‘conditions’ => array(‘Vendor.name’ => ‘Simon’)

I get an error that Vendor.name does not exists, how come? I have included the Model in the paginators ‘contain’ key, and the values are all there. I cannot even use the Pagintors sort options on any modals bound using the bindModel method.

Am I missing a very NB step?

Kind regards,
Simon

Simon on 1/12/11

Thanks, this covers a gaping hole on the documentation and addressed my issues. Please propose to have this techniques added. No one told me you can set foreign key to false and add your own conditions!!!

Jacob 3 weeks, 1 day ago

1 2 next >