Try this:
$result = $this->Tree->find( 'first',
array(
"contain" => array(
"Apple"=>array('limit'=>1)
),
)
);
On Wed, Sep 7, 2011 at 11:51 AM, Rene Weber <[email protected]> wrote:
> Hi there,
>
> I have a Problem with limiting the Output of my find.
> I have a table of trees and a table of apples. Apples belong to trees.
> My view was outmatically generated by CakePHP showing me the Tree details
> and a table of all apples belonging to my tree under it.
> The Find Command in the Controller is
>
>
> $result = $this->Tree->find( 'first',
> array(
> "contain" => array(
> "Apple",
> ),
> )
> );
>
> My Problem comes as soon as I view my biggest tree with 1.000.000 Apples.
> How can I limit the amount of apples through the Query?
> Tried using limit => 1 which does not work, since the find('first') does a
> limit 1 for the tree anyway but not for my apples...
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.orgCheck 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<cake-php%[email protected]>For
> more options, visit this group at
> http://groups.google.com/**group/cake-php<http://groups.google.com/group/cake-php>
>
--
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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php