protected function initStatsSelect(Gpf_SqlBuilder_SelectClause $select) { $select->add('sum(' . self::RAW . ')', self::RAW); $select->add('sum(' . self::UNIQUE . ')', self::UNIQUE); }
public function equals(Gpf_SqlBuilder_SelectClause $select) { return $select->toString() == $this->toString(); }
/** * @return String */ protected function createChannelsWithEmptyRow(Gpf_SqlBuilder_SelectBuilder $select) { $selectNullRow = new Gpf_SqlBuilder_SelectClause(); $selectNullRow->add('\'\'', Pap_Db_Table_Channels::ID); $selectNullRow->add('\' ' . $this->_('None channel') . '\'', Pap_Db_Table_Channels::NAME); return $select->toString() . ' UNION ' . $selectNullRow->toString(); }
public function initSelectClause(Gpf_SqlBuilder_SelectClause $select) { $select->replaceColumn('cnt', 'count(distinct(t.'.Pap_Db_Table_Transactions::SALE_ID.'))', 'cnt'); $select->replaceColumn('totalcost', 'MAX(t.'.Pap_Db_Table_Transactions::TOTAL_COST.')', 'totalcost'); }
public function toString() { return $this->select->toString() . ($this->from->isEmpty() ? '' : "FROM " . $this->from->toString()) . $this->where->toString() . $this->groupBy->toString() . $this->having->toString() . $this->orderBy->toString() . $this->limit->toString(); }