registerNodeTypes() публичный Метод

This is only a proxy to the transport
public registerNodeTypes ( array $types, boolean $allowUpdate ) : boolean
$types array an array of NodeTypeDefinitions
$allowUpdate boolean whether to fail if node already exists or to update it
Результат boolean true on success
Пример #1
0
 /**
  * {@inheritDoc}
  *
  * @api
  */
 public function registerNodeTypes(array $definitions, $allowUpdate)
 {
     $nts = array();
     // prepare them first (all or nothing)
     foreach ($definitions as $definition) {
         $nts[$definition->getName()] = $this->createNodeType($definition, $allowUpdate);
     }
     $this->objectManager->registerNodeTypes($definitions, $allowUpdate);
     // no need to fetch the node types as with cnd, we already have the def and can
     // now register them ourselves
     foreach ($nts as $nt) {
         $this->addNodeType($nt);
     }
     return new ArrayIterator($nts);
 }