Neos\ContentRepository\Security\Authorization\Privilege\Node\NodePrivilegeContext::nodeIsOfType PHP Метод

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

Example: nodeIsOfType(['Neos.ContentRepository:NodeType1', 'Neos.ContentRepository:NodeType2']) matches if the selected node is of (sub) type *Neos.ContentRepository:NodeType1* or *Neos.ContentRepository:NodeType1*
public nodeIsOfType ( string | array $nodeTypes ) : boolean
$nodeTypes string | array A single or an array of fully qualified NodeType name(s), e.g. "Neos.Neos:Document"
Результат boolean TRUE if the selected node matches the $nodeTypes, otherwise FALSE
    public function nodeIsOfType($nodeTypes)
    {
        if ($this->node === null) {
            return true;
        }
        if (!is_array($nodeTypes)) {
            $nodeTypes = array($nodeTypes);
        }
        foreach ($nodeTypes as $nodeType) {
            if ($this->node->getNodeType()->isOfType($nodeType)) {
                return true;
            }
        }
        return false;
    }