in the controller method
$this->ModelNameHere->recursive = -1;
On Tuesday, September 18, 2012 8:10:33 AM UTC-4, Lightee wrote:
>
> THanks! This works!
>
> On Monday, September 17, 2012 5:36:31 PM UTC+8, Andras Kende wrote:
>>
>> easiest way if only need records from current model:
>>
>> $records
THanks! This works!
On Monday, September 17, 2012 5:36:31 PM UTC+8, Andras Kende wrote:
>
> easiest way if only need records from current model:
>
> $records = $this->Record->find('all', array(
> 'recursive' => -1,
> ));
>
>
> Andras Kende
> http://www.kende.com
>
>
> On Sep 17, 2012, at 2:10 AM,
easiest way if only need records from current model:
$records = $this->Record->find('all', array(
'recursive' => -1,
));
Andras Kende
http://www.kende.com
On Sep 17, 2012, at 2:10 AM, Lightee wrote:
> Dear Cakephp experts,
>
> When I use find('all), all the records in the model and
If you are using the containable behaviour, just add 'contain' => array() to
the find call and you'll get back just the current model. If you are not, then
add 'recursive' => 0 to the find call.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 17 Sep 2012, at 10:10:19, Lightee wrote:
Dear Cakephp experts,
When I use find('all), all the records in the model and associated model
will be returned. May I ask if it is possible to bypass the associated
models and show only the records of the model? Do I have to write SQL to do
that?
Thank you.
--
Like Us on FacekBook https://w