Neos\Neos\Service\NodeTypeSchemaBuilder::generateNodeTypeSchema PHP Метод

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

- "nodeTypes" contains the original (merged) node type schema - "inheritanceMap.subTypes" contains for every parent type the transitive list of subtypes - "constraints" contains for each node type, the list of allowed child node types; normalizing whitelists and blacklists: - [node type] - nodeTypes: [child node type name]: TRUE - childNodes: - [child node name] - nodeTypes: [child node type name]: TRUE
public generateNodeTypeSchema ( ) : array
Результат array the node type schema ready to be used by the JavaScript code
    public function generateNodeTypeSchema()
    {
        $schema = array('inheritanceMap' => array('subTypes' => array()), 'nodeTypes' => array(), 'constraints' => $this->generateConstraints());
        $nodeTypes = $this->nodeTypeManager->getNodeTypes(true);
        /** @var NodeType $nodeType */
        foreach ($nodeTypes as $nodeTypeName => $nodeType) {
            if ($nodeType->isAbstract() === false) {
                $configuration = $nodeType->getFullConfiguration();
                $this->flattenAlohaFormatOptions($configuration);
                $schema['nodeTypes'][$nodeTypeName] = $configuration;
                $schema['nodeTypes'][$nodeTypeName]['label'] = $nodeType->getLabel();
            }
            $schema['inheritanceMap']['subTypes'][$nodeTypeName] = array();
            foreach ($this->nodeTypeManager->getSubNodeTypes($nodeType->getName(), true) as $subNodeType) {
                /** @var NodeType $subNodeType */
                $schema['inheritanceMap']['subTypes'][$nodeTypeName][] = $subNodeType->getName();
            }
        }
        return $schema;
    }

Usage Example

 public function setUp()
 {
     parent::setUp();
     $this->nodeTypeSchemaBuilder = $this->objectManager->get(NodeTypeSchemaBuilder::class);
     $this->schema = $this->nodeTypeSchemaBuilder->generateNodeTypeSchema();
 }
All Usage Examples Of Neos\Neos\Service\NodeTypeSchemaBuilder::generateNodeTypeSchema