Jump to content

AtkManyToOneRelation: Difference between revisions

From NusaATK
No edit summary
setLocalKey/setRemoteKey
Line 5: Line 5:
* $destination The node we have a relationship with.
* $destination The node we have a relationship with.


If you do not want to use the default primary keys (for example when the * side has a combined PK), you can override them by using the functions:
setLocalKey("a_id");
setRemoteKey("b_id");


'''Example'''
'''Example'''

Revision as of 12:51, 30 June 2008

atkManyToOneRelation

function atkManyToOneRelation($name, $destination, $flags=0)
  • $name The name of the attribute.
  • $destination The node we have a relationship with.

If you do not want to use the default primary keys (for example when the * side has a combined PK), you can override them by using the functions:

setLocalKey("a_id");
setRemoteKey("b_id");

Example

Projects all have one coordinator (node B), but one coordinator can have multiple projects (node A). So in the project class, there's a atkManyToOneRelation to a coordinator.