protected function _checkNode($path, $alias, $parentId = null)
    {
        $node = $this->Aco->node($path);
        if (!$node) {
            $data = [
                'parent_id' => $parentId,
                'model' => null,
                'alias' => $alias,
            ];
            $entity = $this->Aco->newEntity($data);
            $node = $this->Aco->save($entity);
            $this->counter++;
            // $this->out(__d('cake_acl', 'Created Aco node: {0}', $path));
        } else {
            $node = $node->first();
        }

        return $node;
    }
protected function _checkNode($path, $alias, $parentId = null)
    {
        $node = $this->Aco->node($path);
        if (!$node) {
            $data = [
                'parent_id' => $parentId,
                'model' => null,
                'alias' => $alias,
            ];
            $entity = $this->Aco->newEntity($data);
            $node = $this->Aco->save($entity);
            $this->counter++;
            // $this->out(__d('cake_acl', 'Created Aco node: {0}', $path));
        } else {
            $node = $node->first();
        }

        return $node;
    }
protected function _checkNode ( $ path , $ alias , $ parentId = null ) { $ node = $ this -> Aco -> node ( $ path ) ; if ( ! $ node ) { $ data = [ 'parent_id' => $ parentId , 'model' => null , 'alias' => $ alias , ] ; $ entity = $ this -> Aco -> newEntity ( $ data ) ; $ node = $ this -> Aco -> save ( $ entity ) ; $ this -> counter ++ ; // $this->out(__d('cake_acl', 'Created Aco node: {0}', $path)); } else { $ node = $ node -> first ( ) ; } return $ node ; }
Check a node for existance, create it if it doesn't exist.

@param string $path The path to check
@param string $alias The alias to create
@param int $parentId The parent id to use when creating.
@return array Aco Node array
Check a node for existance create it if it doesn t exist .