/**
  * Add all columns which are defined through {@link requireField()}
  * and {@link $composite_db}, or any additional SQL that is required
  * to get to these columns. Will mostly just write to the {@link SQLSelect->select}
  * array.
  *
  * @param SQLSelect $query
  */
 public function addToQuery(&$query)
 {
     parent::addToQuery($query);
     foreach ($this->compositeDatabaseFields() as $field => $spec) {
         $table = $this->getTable();
         $key = $this->getName() . $field;
         if ($table) {
             $query->selectField("\"{$table}\".\"{$key}\"");
         } else {
             $query->selectField("\"{$key}\"");
         }
     }
 }