Acl\Shell\AclShell::_getNodeId PHP Method

_getNodeId() protected method

Get the node for a given identifier. $identifier can either be a string alias or an array of properties to use in AcoNode::node()
protected _getNodeId ( string $class, string | array $identifier ) : integer | null
$class string Class type you want (Aro/Aco)
$identifier string | array A mixed identifier for finding the node.
return integer | null Integer of NodeId. Will trigger an error if nothing is found.
    protected function _getNodeId($class, $identifier)
    {
        $node = $this->Acl->{$class}->node($identifier);
        if (empty($node) || $node->count() === 0) {
            if (is_array($identifier)) {
                $identifier = var_export($identifier, true);
            }
            $this->error(__d('cake_acl', 'Could not find node using reference "{0}"', [$identifier]));
            return null;
        }
        return $node->first()->id;
    }