Пример #1
0
 /**
  * Fluent select query builder.
  *
  * @param array  Array of DormColumn objects
  * @param array  Array of DormJoin objects
  * @return DibiFluent
  */
 protected function buildDefaultSelect($columns, $joins, $groups)
 {
     $joins = array_reverse($joins);
     array_unique_obj($columns);
     array_unique_obj($joins);
     array_unique_obj($groups);
     $select = '';
     foreach ($columns as $c) {
         $select .= $c->getWithAlias() . ', ';
     }
     $select = substr($select, 0, -2);
     $query = $this->db->select($select)->from($this->table);
     foreach ($joins as $join) {
         $query = $join->appendTo($query);
     }
     foreach ($groups as $group) {
         $query = $group->appendTo($query);
     }
     return $query;
 }
Пример #2
0
 public function getGroups()
 {
     array_unique_obj($this->groups);
     return $this->groups;
 }