original_string: protected function fetchRelation(array $relation)
      {
          /* a relation is of the form
           * [$type, $foreign_class, $foreign_column, $column]
           */
          list($type, $foreign_class, $foreign_column, $column) = $relation;
  
          switch ($type) {
          case 'has_one':
              return $this->fetchOneToOne($foreign_class, $foreign_column, $column);
          case 'belongs_to':
              return $this->fetchOneToOne($foreign_class, $foreign_column, $column);
          case 'has_many':
              return $this->fetchOneToMany($foreign_class, $foreign_column, $column);
          default:
          }
      }
code: protected function fetchRelation(array $relation)
      {
          /* a relation is of the form
           * [$type, $foreign_class, $foreign_column, $column]
           */
          list($type, $foreign_class, $foreign_column, $column) = $relation;
  
          switch ($type) {
          case 'has_one':
              return $this->fetchOneToOne($foreign_class, $foreign_column, $column);
          case 'belongs_to':
              return $this->fetchOneToOne($foreign_class, $foreign_column, $column);
          case 'has_many':
              return $this->fetchOneToMany($foreign_class, $foreign_column, $column);
          default:
          }
      }
code_tokens: protected function fetchRelation ( array $ relation ) { /* a relation is of the form
           * [$type, $foreign_class, $foreign_column, $column]
           */ list ( $ type , $ foreign_class , $ foreign_column , $ column ) = $ relation ; switch ( $ type ) { case 'has_one' : return $ this -> fetchOneToOne ( $ foreign_class , $ foreign_column , $ column ) ; case 'belongs_to' : return $ this -> fetchOneToOne ( $ foreign_class , $ foreign_column , $ column ) ; case 'has_many' : return $ this -> fetchOneToMany ( $ foreign_class , $ foreign_column , $ column ) ; default : } }
docstring: Fetch a related entity from the database.
  
  @param array $relation The relation to fetch.
docstring_tokens: Fetch a related entity from the database .