Jackalope\NodeType\NodeTypeManager::fetchNodeTypes PHP Метод

fetchNodeTypes() защищенный Метод

Without a filter parameter, this will fetch all node types from the backend. It is no problem to call this method with null as name, it will remember once it fetched all node types and do nothing after that. On fetch all, already cached node types are kept.
protected fetchNodeTypes ( string $name = null )
$name string type name to fetch. defaults to null which will fetch all nodes.
    protected function fetchNodeTypes($name = null)
    {
        if ($this->fetchedAllFromBackend) {
            return;
        }
        if (null !== $name) {
            if (!empty($this->primaryTypes[$name]) || !empty($this->mixinTypes[$name])) {
                return;
                //we already know this node
            }
            //OPTIMIZE: also avoid trying to fetch nonexisting definitions we already tried to get
            $nodeTypes = $this->objectManager->getNodeType($name);
        } else {
            $nodeTypes = $this->objectManager->getNodeTypes();
            $this->fetchedAllFromBackend = true;
        }
        foreach ($nodeTypes as $nodeType) {
            $nodeType = $this->factory->get('NodeType\\NodeType', array($this, $nodeType));
            $name = $nodeType->getName();
            //do not overwrite existing types. maybe they where changed locally
            if (empty($this->primaryTypes[$name]) && empty($this->mixinTypes[$name])) {
                $this->addNodeType($nodeType);
            }
        }
    }