mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
(mvc) add parent to BaseField to support logic spawning over different fields
This commit is contained in:
parent
186816e6e6
commit
dfd37ca27b
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user