projects
  id
  name
  resource_id

resources
  id
  resource_category_id

resource_categories
  id
  name //Tools, People,

On 6 jan, 13:07, James <[email protected]> wrote:
> I have a  Project table containing two fields resource1 and resource2.
> Each resource_id could map to either tool table or people table.
> What's the relationship?
>
> class Project extends AppModel {
>     var $name = 'Project';
>     var $belongsTo = array(
>
>         'resource1' => array(
>             'className'    => 'Tool' OR 'People',
>             'foreignKey'    => 'resource1_id'
>         ),
>
>         'resource2' => array(
>             'className'    => 'Tool' OR 'People',
>             'foreignKey'    => 'resource2_id'
>         )
>     );
>
> }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to