original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Returns a single node from the tree from its primary key