List Info

Thread: use of recursive




use of recursive
user name
2006-05-29 16:37:45
my models:
execution hasMany result
state hasMany result
result belongsTo execution,state


What I want to do:
>From the execution View, I need to now the state of all
the result


I try to set the recursive at 2 from the execution
controller:
$this->set('data',
$this->Execution->findAll($conditions,null,null,null,1
,2));

In the view I only got
the right $data['execution']['result']['state_id']
but $data['execution']['result']['state'] is still
null

That's how the query is build
SELECT `state`.`id`, `state`.`name` FROM `state` AS `state`
WHERE
`state`.`id` = {$__cakeForeignKey__$}

and the query:
SELECT `state`.`id`, `state`.`name` FROM `state` AS `state`
WHERE
`state`.`id` = NULL

Why did I got `state`.`id` = NULL ???

I hope someone can understood my problem


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Cake PHP" group.
To post to this group, send email to cake-phpgooglegroups.com
To unsubscribe from this group, send email to
cake-php-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

use of recursive
user name
2006-05-30 09:07:05
It was just an error in the $belongsTo and $hasMany naming :
The
uppercase was'nt uppercase


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Cake PHP" group.
To post to this group, send email to cake-phpgooglegroups.com
To unsubscribe from this group, send email to
cake-php-unsubscribegooglegroups.com
For more options, visit this group at http://groups
.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )