Jackalope\NodeType\NodeTypeDefinition::fromArray PHP Method

fromArray() protected method

Reads the node type definition from an array
protected fromArray ( array $data )
$data array an array with key-value information
    protected function fromArray(array $data)
    {
        $this->name = $data['name'];
        $this->isAbstract = $data['isAbstract'];
        $this->isMixin = $data['isMixin'];
        $this->isQueryable = $data['isQueryable'];
        $this->hasOrderableChildNodes = $data['hasOrderableChildNodes'];
        $this->primaryItemName = $data['primaryItemName'] ?: null;
        $this->declaredSuperTypeNames = isset($data['declaredSuperTypeNames']) && count($data['declaredSuperTypeNames']) ? $data['declaredSuperTypeNames'] : array();
        $this->declaredPropertyDefinitions = new ArrayObject();
        foreach ($data['declaredPropertyDefinitions'] as $propertyDef) {
            $this->declaredPropertyDefinitions[] = $this->factory->get('NodeType\\PropertyDefinition', array($propertyDef, $this->nodeTypeManager));
        }
        $this->declaredNodeDefinitions = new ArrayObject();
        foreach ($data['declaredNodeDefinitions'] as $nodeDef) {
            $this->declaredNodeDefinitions[] = $this->factory->get('NodeType\\NodeDefinition', array($nodeDef, $this->nodeTypeManager));
        }
    }