Ok more feedback on this.... in the same scenario described above, for
the same Machine->afterFind() defined as:
<?php
function afterFind($results, $primary = false) {
var_dump($primary);
print_r($results);
return $results;
}
?>
===
/services/view/ABC:
===
true
Array
(
[0] => Array
(
[id] =>
[category_id] =>
etc.
[MachinesService] => Array
(
)
[Type] => Array
(
)
[MachineContact] => Array
(
)
)
===
/machines/view/RST:
===
true
Array
(
[0] => Array
(
[Machine] => Array
(
[id] =>
[category_id] =>
etc.
)
[Type] => Array
(
)
[MachineContact] => Array
(
)
[Service] => Array
(
)
)
)
===
/types/view/XYZ:
===
false
Array
(
[0] => Array
(
[Machine] => Array
(
[id] =>
[category_id] =>
etc.
)
)
)
Note that primary is "true" for cases 1 and 2 and "false" for case 3.
Still, output for cases 2 and 3 are equivalent, and different from the
output of case 1. To make things even more complicated, according to
the manual [1] the value of $primary of cases 1,2,3 should be false,
true, false but they are in fact true, true, false and yet their
output are as they were false, true, true. confusing isn't it ? O.o
[1] http://book.cakephp.org/view/681/afterFind
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---