public function checkNodeOrSave($path, $alias, $parentId = null) {
        $node = $this->Aco->node($path);
        if ($node === false) {
            $data = [
                'parent_id' => $parentId,
                'model' => null,
                'alias' => $alias,
            ];
            $entity = $this->Aco->newEntity($data);
            $node = $this->Aco->save($entity);
            return $node;
        }
        return $node->first();
    }
public function checkNodeOrSave($path, $alias, $parentId = null) {
        $node = $this->Aco->node($path);
        if ($node === false) {
            $data = [
                'parent_id' => $parentId,
                'model' => null,
                'alias' => $alias,
            ];
            $entity = $this->Aco->newEntity($data);
            $node = $this->Aco->save($entity);
            return $node;
        }
        return $node->first();
    }
public function checkNodeOrSave ( $ path , $ alias , $ parentId = null ) { $ node = $ this -> Aco -> node ( $ path ) ; if ( $ node === false ) { $ data = [ 'parent_id' => $ parentId , 'model' => null , 'alias' => $ alias , ] ; $ entity = $ this -> Aco -> newEntity ( $ data ) ; $ node = $ this -> Aco -> save ( $ entity ) ; return $ node ; } return $ node -> first ( ) ; }
Check if the aco exist and store it if empty

@param string $path     the path like App/Admin/Admin/home
@param string $alias    the name of the alias like home
@param null   $parentId the parent id

@return object
Check if the aco exist and store it if empty