/** * @static * * @param Node $pNode * @param array $pChildren */ function installNodes(Node $pNode, $pChildren) { /* * 0: type * 1: Title * 2: layout * 3: url * 4: link target * 5: contents * 6: children * 7: visible */ foreach ($pChildren as $Node) { $oNode = new Node(); $oNode->setDomainId($pNode->getDomainId()); $oNode->setType($Node[0]); $oNode->setTitle($Node[1]); $oNode->setLayout($Node[2]); $oNode->setUrn($Node[3]); $oNode->insertAsLastChildOf($pNode); if ($Node[4]) { $oNode->setLink($Node[4]); } if (isset($Node[7])) { $oNode->setVisible($Node[7]); } else { $oNode->setVisible(1); } $oNode->save(); if (isset($Node[5])) { $this->installContents($oNode, $Node[5]); } if (isset($Node[6])) { $this->installNodes($oNode, $Node[6]); } } }