public function validateByParent($nodeType, NodeInterface $parent = null)
    {
        if (!$nodeType) {
            return true;
        }

        $config = $this->getNodeTypeConfig($nodeType);
        if (null === $config) {
            return false;
        }

        if ((null !== $parent) && $parent->getType()) {
            return in_array($parent->getType(), $config->getParentTypes());
        }

        return false;
    }
public function validateByParent($nodeType, NodeInterface $parent = null)
    {
        if (!$nodeType) {
            return true;
        }

        $config = $this->getNodeTypeConfig($nodeType);
        if (null === $config) {
            return false;
        }

        if ((null !== $parent) && $parent->getType()) {
            return in_array($parent->getType(), $config->getParentTypes());
        }

        return false;
    }
public function validateByParent ( $ nodeType , NodeInterface $ parent = null ) { if ( ! $ nodeType ) { return true ; } $ config = $ this -> getNodeTypeConfig ( $ nodeType ) ; if ( null === $ config ) { return false ; } if ( ( null !== $ parent ) && $ parent -> getType ( ) ) { return in_array ( $ parent -> getType ( ) , $ config -> getParentTypes ( ) ) ; } return false ; }
Validate by parent.

@param string $nodeType
@param NodeInterface $parent

@return bool
Validate by parent .