Tuesday, March 29, 2011

paginate conditions hasMany question

Hi,

I struggle...

I have the following statement:
$list = $this->paginate('Member');
Which returns an array (in short) like this:

Array
(
[0] => Array
(
[Member] => Array
(
[id] => 5
)

[Payment] => Array
(
[0] => Array
(
[id] => 2520
[member_id] => 5

The debug mode shows me that there are 2 mysql statements performed.
One to get the members and one to get the payments.

The model is that members hasMany paymennts.
And payment belongTo a member.

I dont get it now, how I can set conditions regarding the payment
select?
For example I just want to select members where the payment status =
1.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate