Yes, it is supposed to be like this.

When you do a findAll on SolutionProcess, you are going to get an
array of SolutionProcess results.  If SolutionProcess is associated
with any models (and your recursive causes them to be found), then
they will appear as siblings to SolutionProcess, so:

$results = array(
  array( SolutionProcess, SolutionCategory ),
  array( SolutionProcess, SolutionCategory )
)

When your recursive goes beyond 1 though, the new associations cannot
be at the same level.  What about when these further joins are
associated to the same table - whose data appears as a sibling?  So
all second and third level associations are as children, rather than
siblings.

What can also be confusing is where the model name keys are used for
belongsTo vs hasMany.  belongsTo will give you

$results = array(
  0 => array(
     'MainModel' => array(...data...),
     'MainModelBelongsTo' => array(...data...)
  )
)

whereas hasMany would give
$results = array(
  0 => array(
     'MainModel' => array(...data...),
     'MainModelHasMany' => array(
        0 => array(...data...),
        1 => array(...data...)
     )
  )
)

such that the associated model name key ("MainModelBelongsTo" or
"MainModelHasMany") is still at the sibling level, but with hasMany
the children found do not have this model key, even if they themselves
have associations.

Anyway, it is probably best that you play around with a number of
associations to get the hang of it.  But what you are seeing is the
expected behaviour.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to