/** * Converts the raw query results into the format as specified by this query. * This method is internally used to convert the data fetched from database * into the format as required by this query. * @param array $rows the raw query result from database * @return array the converted query result */ public function populate($rows) { $result = []; foreach ($rows as $file) { $row = $file->file; $row['file'] = $file; $result[] = $row; } return parent::populate($result); }