Neos\Neos\Service\ContentElementWrappingService::addGenericEditingMetadata PHP Метод

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

Collects metadata attributes used to allow editing of the node in the Neos backend.
protected addGenericEditingMetadata ( array $attributes, Neos\ContentRepository\Domain\Model\NodeInterface $node ) : array
$attributes array
$node Neos\ContentRepository\Domain\Model\NodeInterface
Результат array
    protected function addGenericEditingMetadata(array $attributes, NodeInterface $node)
    {
        $attributes['typeof'] = 'typo3:' . $node->getNodeType()->getName();
        $attributes['about'] = $node->getContextPath();
        $attributes['data-node-_identifier'] = $node->getIdentifier();
        $attributes['data-node-__workspace-name'] = $node->getWorkspace()->getName();
        $attributes['data-node-__label'] = $node->getLabel();
        if ($node->getNodeType()->isOfType('Neos.Neos:ContentCollection')) {
            $attributes['rel'] = 'typo3:content-collection';
        }
        // these properties are needed together with the current NodeType to evaluate Node Type Constraints
        // TODO: this can probably be greatly cleaned up once we do not use CreateJS or VIE anymore.
        if ($node->getParent()) {
            $attributes['data-node-__parent-node-type'] = $node->getParent()->getNodeType()->getName();
        }
        if ($node->isAutoCreated()) {
            $attributes['data-node-_name'] = $node->getName();
            $attributes['data-node-_is-autocreated'] = 'true';
        }
        if ($node->getParent() && $node->getParent()->isAutoCreated()) {
            $attributes['data-node-_parent-is-autocreated'] = 'true';
            // we shall only add these properties if the parent is actually auto-created; as the Node-Type-Switcher in the UI relies on that.
            $attributes['data-node-__parent-node-name'] = $node->getParent()->getName();
            $attributes['data-node-__grandparent-node-type'] = $node->getParent()->getParent()->getNodeType()->getName();
        }
        return $attributes;
    }