populate() public method

This method is internally used to convert the data fetched from database into the format as required by this query.
public populate ( array $rows ) : array
$rows array the raw query result from database
return array the converted query result
 /**
  * @param array $rows
  * @return array
  */
 public function populate($rows)
 {
     if ($this->indexBy === null) {
         if ($this->asArray) {
             return $rows;
         }
         $result = [];
         foreach ($rows as $row) {
             $result[] = $this->createObject($row);
         }
         return $result;
     } else {
         return parent::populate($rows);
     }
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function populate($rows)
 {
     return parent::populate($this->fillUpSnippets($rows));
 }