Acl\Model\Behavior\AclBehavior::node PHP Method

node() public method

Retrieves the Aro/Aco node for this model
public node ( string | array | Model $ref = null, string $type = null ) : Cake\ORM\Query
$ref string | array | Model Array with 'model' and 'foreign_key', model object, or string value
$type string Only needed when Acl is set up as 'both', specify 'Aro' or 'Aco' to get the correct node
return Cake\ORM\Query
    public function node($ref = null, $type = null)
    {
        if (empty($type)) {
            $type = $this->_typeMaps[$this->config('type')];
            if (is_array($type)) {
                trigger_error(__d('cake_dev', 'AclBehavior is setup with more then one type, please specify type parameter for node()'), E_USER_WARNING);
                return null;
            }
        }
        if (empty($ref)) {
            throw new Exception\Exception(__d('cake_dev', 'ref parameter must be a string or an Entity'));
        }
        return $this->_table->{$type}->node($ref);
    }