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

This commit is contained in:
Ad Schellevis 2015-09-22 13:36:49 +02:00
parent 186816e6e6
commit dfd37ca27b

View File

@ -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;
}
/**