protected function _getNode($id)
    {
        $config = $this->getConfig();
        list($parent, $left, $right) = [$config['parent'], $config['left'], $config['right']];
        $primaryKey = $this->_getPrimaryKey();
        $fields = [$parent, $left, $right];
        if ($config['level']) {
            $fields[] = $config['level'];
        }

        $node = $this->_scope($this->_table->find())
            ->select($fields)
            ->where([$this->_table->aliasField($primaryKey) => $id])
            ->first();

        if (!$node) {
            throw new RecordNotFoundException("Node \"{$id}\" was not found in the tree.");
        }

        return $node;
    }
protected function _getNode($id)
    {
        $config = $this->getConfig();
        list($parent, $left, $right) = [$config['parent'], $config['left'], $config['right']];
        $primaryKey = $this->_getPrimaryKey();
        $fields = [$parent, $left, $right];
        if ($config['level']) {
            $fields[] = $config['level'];
        }

        $node = $this->_scope($this->_table->find())
            ->select($fields)
            ->where([$this->_table->aliasField($primaryKey) => $id])
            ->first();

        if (!$node) {
            throw new RecordNotFoundException("Node \"{$id}\" was not found in the tree.");
        }

        return $node;
    }
protected function _getNode ( $ id ) { $ config = $ this -> getConfig ( ) ; list ( $ parent , $ left , $ right ) = [ $ config [ 'parent' ] , $ config [ 'left' ] , $ config [ 'right' ] ] ; $ primaryKey = $ this -> _getPrimaryKey ( ) ; $ fields = [ $ parent , $ left , $ right ] ; if ( $ config [ 'level' ] ) { $ fields [ ] = $ config [ 'level' ] ; } $ node = $ this -> _scope ( $ this -> _table -> find ( ) ) -> select ( $ fields ) -> where ( [ $ this -> _table -> aliasField ( $ primaryKey ) => $ id ] ) -> first ( ) ; if ( ! $ node ) { throw new RecordNotFoundException ( "Node \"{$id}\" was not found in the tree." ) ; } return $ node ; }
Returns a single node from the tree from its primary key

@param mixed $id Record id.
@return \Cake\Datasource\EntityInterface
@throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
Returns a single node from the tree from its primary key