original_string: public function hydrate(PDOStatement $results) {
  
      if (method_exists($this, 'preHydrate')) {
        $results = $this->preHydrate($results);
      }
  
      $return = array();
  
      if ($results) {
        $arrayResults = $results->fetchAll();
        foreach ($arrayResults as $arrayResult) {
          $className = get_class($this);
          $object = new $className();
          $return[$arrayResult[$this->id_name]] = $object->setRecord($arrayResult);
        }
      }
  
      if (method_exists($this, 'postHydrate')) {
        $return = $this->preHydrate($return);
      }
  
      return $return;
    }
code: public function hydrate(PDOStatement $results) {
  
      if (method_exists($this, 'preHydrate')) {
        $results = $this->preHydrate($results);
      }
  
      $return = array();
  
      if ($results) {
        $arrayResults = $results->fetchAll();
        foreach ($arrayResults as $arrayResult) {
          $className = get_class($this);
          $object = new $className();
          $return[$arrayResult[$this->id_name]] = $object->setRecord($arrayResult);
        }
      }
  
      if (method_exists($this, 'postHydrate')) {
        $return = $this->preHydrate($return);
      }
  
      return $return;
    }
code_tokens: public function hydrate ( PDOStatement $ results ) { if ( method_exists ( $ this , 'preHydrate' ) ) { $ results = $ this -> preHydrate ( $ results ) ; } $ return = array ( ) ; if ( $ results ) { $ arrayResults = $ results -> fetchAll ( ) ; foreach ( $ arrayResults as $ arrayResult ) { $ className = get_class ( $ this ) ; $ object = new $ className ( ) ; $ return [ $ arrayResult [ $ this -> id_name ] ] = $ object -> setRecord ( $ arrayResult ) ; } } if ( method_exists ( $ this , 'postHydrate' ) ) { $ return = $ this -> preHydrate ( $ return ) ; } return $ return ; }
docstring: Default Hydrate.
  
  Use preHydrate and postHydrate methods to change the default behavior.
  You can override this method too if you need.
  
  @param PDOStatement $results
  
  @return Array of Model Objects
docstring_tokens: Default Hydrate .