Jump to content

ATK Relations

From NusaATK
Revision as of 12:06, 14 July 2006 by Jeroenvs (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

atkOneToOneRelation

The atkOneToOneRelation supports two configurations: master mode and slave mode. The mode to use is detected automatically based on the value of the $refKey parameter.

function atkOneToOneRelation($name, $destination, $refKey="", $flags=0)
  • $name: The unique name of the attribute.
  • $destination: the destination node (in module.nodename notation)
  • $refKey: foreign-key field (master mode) or empty (slave mode)

Master mode

The current node is considered the master, and the referential key pointing to the master record is in the destination node.

Example

One to One relation in node A to node B. Referential key is in the other node, so this is the master-configuration:



Slave mode

The current node is considered the child, and the referential key pointing to the master record is in the current node.


atkOneToManyRelation

atkManyToOneRelation