Hi Martin,

For the given example, grant pointed out that it is easy/difficult
depending on the direction you are retrieving the data.


Going from a Person/Organisation to an address should be fairly easy:
Person/Org
        var $hasMany = array(
                        'Comment'=>array(
                                                "foreignKey"=>"foreign_id",
                                                
"conditions"=>"`Comment`.`class`='person'",
                                                "dependent"=>true,
                                                )
                                                );

Going from address to Person/Org is slightly more tricky but quite
achievable.
if you make use of the afterFind method in your address model, you
could then bindModel the appropriate owner class and "attach" results
to the returned data set. That is if you really needed to ;).

HTH,

AD7six


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to