public function setNode(Node $node) { $this->node = $node; $this->setDefaults(array('name' => (string) $node, 'alias' => $node->hasAlias() ? $node->getAlias() : '', 'display' => $node->getDisplay(), 'operator' => $node->getOperator(), 'url' => $node->getInfoUrl(), 'children' => array_keys($node->getChildren()))); $this->getElement('name')->setAttrib('readonly', true); return $this; }
public function addNode($name, Node $node) { if (array_key_exists($name, $this->nodes)) { $this->warn(sprintf(mt('businessprocess', 'Node "%s" has been defined twice'), $name)); } $this->nodes[$name] = $node; if ($node->getDisplay() > 0) { if (!$this->isRootNode($name)) { $this->addRootNode($name); } } else { if ($this->isRootNode($name)) { $this->removeRootNode($name); } } return $this; }