Commit dfd37ca2 authored by Ad Schellevis's avatar Ad Schellevis

(mvc) add parent to BaseField to support logic spawning over different fields

parent 186816e6
......@@ -45,6 +45,11 @@ abstract class BaseField
*/
protected $internalChildnodes = array();
/**
* @var null pointer to parent
*/
protected $internalParentNode = null;
/**
* @var bool marks if this is a data node or a container
*/
......@@ -185,6 +190,16 @@ abstract class BaseField
public function addChildNode($name, $node)
{
$this->internalChildnodes[$name] = $node;
$node->setParentNode($this);
}
/**
* set pointer to parent node, used by addChildNode to backref this node
* @param BaseField $node pointer to parent
*/
private function setParentNode($node)
{
$this->internalParentNode = $node;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment