@param $nodeName

@return ProcessorDefinitionInterface

@throws \Exception
970752
protected function getDefinitionService($nodeName)
    {
        /** @var ProcessorDefinitionInterface $definition */
        $definition = $this->container->get('smartesb.registry.processor_definitions')->findDefinition($nodeName);

        $definition->setBuilder($this);

        return $definition;
    }
363512
public function node2Scope(SiteTreeNodeInterface $node){

        $scope = new TreeScope();
        $urlSegment = trim($node->getUrlSegment(),'/');

        $name = $urlSegment ? $urlSegment : TreeScope::DEFAULT_NAME;

        $scope->setPathPrefix($node->getUrlSegment());
        $scope->setName($name);
        $scope->setTitle($node->getMenuTitle());
        $scope->setModelRootId($node->{$this->treeModel->rootCol()});

        return $scope;

    }
831004
public function createChildNodes(NodeInterface $node)
    {
        $nodeType = $node->getNodeType();
        foreach ($nodeType->getAutoCreatedChildNodes() as $childNodeName => $childNodeType) {
            try {
                $node->createNode($childNodeName, $childNodeType);
            } catch (NodeExistsException $exception) {
                // If you have a node that has been marked as removed, but is needed again
                // the old node is recovered
                $childNodePath = NodePaths::addNodePathSegment($node->getPath(), $childNodeName);
                $contextProperties = $node->getContext()->getProperties();
                $contextProperties['removedContentShown'] = true;
                $context = $this->contextFactory->create($contextProperties);
                $childNode = $context->getNode($childNodePath);
                if ($childNode->isRemoved()) {
                    $childNode->setRemoved(false);
                }
            }
        }
    }
173506
public function removeNode(NodeInterface $node): NodeInterface
    {
        unset($this->_nodes[$node->getId()]);

        if ($this->getParent()) {
            $this->getParent()->removeNode($node);
        }

        return $this;
    }
1057733
protected function addMappingNode(
        string $nodeName,
        string $entityClass,
        string $entityMappingFile,
        string $entityManager,
        bool $entityEnabled
    ): NodeDefinition {
        $builder = new TreeBuilder();
        $node = $builder->root($nodeName);
        $node
            ->treatFalseLike([
                'enabled' => false,
            ])
            ->addDefaultsIfNotSet()
            ->children()
                ->scalarNode('class')
                    ->defaultValue($entityClass)
                    ->cannotBeEmpty()
                ->end()
                ->scalarNode('mapping_file')
                    ->defaultValue($entityMappingFile)
                    ->cannotBeEmpty()
                ->end()
                ->scalarNode('manager')
                    ->defaultValue($entityManager)
                    ->cannotBeEmpty()
                ->end()
                ->booleanNode('enabled')
                    ->defaultValue($entityEnabled)
                ->end()
            ->end()
        ->end();

        return $node;
    }
254855
public function getChildNode($nodeName = "", $nodeAttributes = array())
    {
        // init
        $obj = null;
        $count = 0;

        // action
        foreach ($this->Nodes as $node) {
            if (gettype($node) == 'object'
                && get_class($node) == 'Com\PaulDevelop\Library\Modeling\Xml\Tag'
            ) {
                if ($node->Name == $nodeName) {
                    // if found child node with good name, check attributes as well
                    $allAttributesAreOK = true;
                    foreach ($nodeAttributes as $key => $value) {
                        if ($node[$key]->Value != $value) {
                            $allAttributesAreOK = false;
                            break;
                        }
                    }

                    if ($allAttributesAreOK == true) {
                        $count++;
                        if ($count > 1) {
                            throw new MultipleChildrenFoundException(
                                'Found multiple children with name "'.$nodeName.'".'
                            );
                        }
                        $obj = $node;
                    }
                }
            }
        }

        // return
        return $obj;
    }
1056179
static function nodeAliasID( $nodeName )
    {
        if ( is_numeric( $nodeName ) )
            return $nodeName;
        $browseINI = eZINI::instance( 'browse.ini' );
        $aliasList = $browseINI->variable( 'BrowseSettings', 'AliasList' );
        if ( isset( $aliasList[$nodeName] ) )
            return $aliasList[$nodeName];
        $contentINI = eZINI::instance( 'content.ini' );
        if ( $nodeName == 'content' )
            return $contentINI->variable( 'NodeSettings', 'RootNode' );
        else if ( $nodeName == 'users' )
            return $contentINI->variable( 'NodeSettings', 'UserRootNode' );
        else if ( $nodeName == 'media' )
            return $contentINI->variable( 'NodeSettings', 'MediaRootNode' );
        else if ( $nodeName == 'setup' )
            return $contentINI->variable( 'NodeSettings', 'SetupRootNode' );
        else
            return false;
    }
39513
public static function createChild(\DOMNode $rootNode, $nodeName, $nodeText = "", $uri = "")
    {
        if (empty($nodeName)) {
            throw new XmlUtilException("Node name must be a string.");
        }

        $nodeworking = XmlUtil::createChildNode($rootNode, $nodeName, $uri);
        self::addTextNode($nodeworking, $nodeText);
        $rootNode->appendChild($nodeworking);
        return $nodeworking;
    }
3314
public function getProcessor(string $id)
    {
        if (!isset($this->_processors[$id])) {
            throw new \RuntimeException('Processor with ID "'.$id.'" is not registered on the logger factory.');
        }

        return $this->_processors[$id];
    }
1300671
protected function renderNodePropertyAttribute(NodeInterface $node, $propertyName)
    {
        $attributes = [];
        /** @var $contentContext ContentContext */
        $contentContext = $node->getContext();
        // skip the node name of the site node - TODO: Why do we need this?
        if ($propertyName === '_name' && $node === $contentContext->getCurrentSiteNode()) {
            return $attributes;
        }

        $dataType = $node->getNodeType()->getPropertyType($propertyName);
        $dasherizedPropertyName = $this->dasherize($propertyName);

        $propertyValue = $this->nodePropertyConverterService->getProperty($node, $propertyName);
        $propertyValue = $propertyValue === null ? '' : $propertyValue;
        $propertyValue = !is_string($propertyValue) ? json_encode($propertyValue) : $propertyValue;

        if ($dataType !== 'string') {
            $attributes['data-nodedatatype-' . $dasherizedPropertyName] = 'xsd:' . $dataType;
        }

        $attributes['data-node-' . $dasherizedPropertyName] = $propertyValue;

        return $attributes;
    }
892849
public function getChildNodes($nodeName = "", $nodeAttributes = array())
    {
        // init
        $obj = new TagCollection(); // array(); // null;
        $count = 0;

        // action
        foreach ($this->Nodes as $node) {
            if (gettype($node) == 'object'
                && get_class($node) == 'Com\PaulDevelop\Library\Modeling\Xml\Tag'
            ) {
                if ($node->Name == $nodeName) {
                    // if found child node with good name, check attributes as well
                    $allAttributesAreOK = true;
                    foreach ($nodeAttributes as $key => $value) {
                        if ($node[$key]->Value != $value) {
                            $allAttributesAreOK = false;
                            break;
                        }
                    }

                    if ($allAttributesAreOK == true) {
                        $count++;
                        $obj->add($node, $count);
                    }
                }
            }
        }

        // return
        return $obj;
    }
577472
public static function namedType(string $typeName): NamedTypeNode
    {
        return self::validateType(
            self::parseType($typeName),
            NamedTypeNode::class
        );
    }
574603
public function process($processor) {
        if (!$processor instanceof base_processor) { // No correct processor, throw exception
            throw new base_element_struct_exception('incorrect_processor');
        }

        $iterator = $this->get_iterator($processor); // Get the iterator over backup-able data

        foreach ($iterator as $key => $values) { // Process each "ocurrrence" of the nested element (recordset or array)

            // Fill the values of the attributes and final elements with the $values from the iterator
            $this->fill_values($values);

            // Perform pre-process tasks for the nested_element
            $processor->pre_process_nested_element($this);

            // Delegate the process of each attribute
            foreach ($this->get_attributes() as $attribute) {
                $attribute->process($processor);
            }

            // Main process tasks for the nested element, once its attributes have been processed
            $processor->process_nested_element($this);

            // Delegate the process of each final_element
            foreach ($this->get_final_elements() as $final_element) {
                $final_element->process($processor);
            }

            // Delegate the process to the optigroup
            if ($this->get_optigroup()) {
                $this->get_optigroup()->process($processor);
            }

            // Delegate the process to each child nested_element
            foreach ($this->get_children() as $child) {
                $child->process($processor);
            }

            // Perform post-process tasks for the nested element
            $processor->post_process_nested_element($this);

            // Everything processed, clean values before next iteration
            $this->clean_values();

            // Increment counter for this element
            $this->counter++;

            // For root element, check we only have 1 element
            if ($this->get_parent() === null && $this->counter > 1) {
                throw new base_element_struct_exception('root_only_one_ocurrence', $this->get_name());
            }
        }
        // Close the iterator (DB recordset / array iterator)
        $iterator->close();
    }
398859
protected function getNodeAsObject($xquery, $className)
    {
      $nodeList = $this->document->getXPath()->query($xquery, $this->node);

      if($nodeList->length == 0)
        throw new Exception(__METHOD__ . '; ' . $xquery . ' node is missing');

      return new $className($this->document, $nodeList->item(0));
    }
1047611
protected function getValuesOfArrayNode($nodeName)
    {
        $domElements = $this->getDomElement()->getElementsByTagName($nodeName);

        $values = array();
        for ($i = 0; $i < $domElements->length; $i++) {
            $values[$i] = $domElements->item($i)->nodeValue;
        }

        return $values;
    }
515704
public function withExplicitlyDisallowedNodeType(NodeTypeName $nodeTypeName): NodeTypeConstraints
    {
        $disallowedNodeTypeNames = $this->explicitlyDisallowedNodeTypeNames;
        $disallowedNodeTypeNames[] = $nodeTypeName;
        return new NodeTypeConstraints($this->wildcardAllowed, $this->explicitlyAllowedNodeTypeNames, $disallowedNodeTypeNames);
    }
1049687
public function setNode(?string $node): NodeAwareDefinitionInterface
    {
        if ($node && !preg_match('/\w+/', $node)) {
            throw new \InvalidArgumentException('Invalid node name');
        }

        $this->node = $node;

        return $this;
    }