original_string: public function hydrate($model, array $fields = array())
      {
          if (is_array($model)) {
              return $this->getRepository($this->resolveModelClassName(reset($model)))->hydrate($model, $fields);
          }
  
          $row = $this->getRepository($this->resolveModelClassName($model))->hydrate(array($model), $fields);
  
          if (empty($row)) {
              return null;
          }
  
          return $row[0];
      }
code: public function hydrate($model, array $fields = array())
      {
          if (is_array($model)) {
              return $this->getRepository($this->resolveModelClassName(reset($model)))->hydrate($model, $fields);
          }
  
          $row = $this->getRepository($this->resolveModelClassName($model))->hydrate(array($model), $fields);
  
          if (empty($row)) {
              return null;
          }
  
          return $row[0];
      }
code_tokens: public function hydrate ( $ model , array $ fields = array ( ) ) { if ( is_array ( $ model ) ) { return $ this -> getRepository ( $ this -> resolveModelClassName ( reset ( $ model ) ) ) -> hydrate ( $ model , $ fields ) ; } $ row = $ this -> getRepository ( $ this -> resolveModelClassName ( $ model ) ) -> hydrate ( array ( $ model ) , $ fields ) ; if ( empty ( $ row ) ) { return null ; } return $ row [ 0 ] ; }
docstring: Hydrate a model.
  
  @param mixed $model
  @param array $fields List of fields prime (optional)
  
  @return null|object|object[]
docstring_tokens: Hydrate a model .