You can also specify which fields you want to return.
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html
<?php
array(
'conditions' => array('Model.field' => $thisValue), //array of
conditions
'recursive' => 1, //int
'fields' => array('Model.field1', 'DISTINCT Model.field2'), //
array of field names
'order' => array('Model.created', 'Model.field3 DESC'), //string
or array defining order
'group' => array('Model.field'), //fields to GROUP BY
'limit' => n, //int
'page' => n, //int
'offset' => n, //int
'callbacks' => true //other possible values are false, 'before',
'after'
)
On Jan 23, 11:45 am, phpMagpie <p...@webbedit.co.uk> wrote:
> Limit what you fetch in the first place using the containable behaviour
> which you can set to fetch the models and/or fields:http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html
>
> contain => array(
> 'Friends' // all fields from related friends results
> )
>
> contain => array(
> 'Friends.email' // will only fetch Friends.id and Friends.email fields
> )
>
> HTH, Paul.
--
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
No comments:
Post a Comment