public function testDistinct()
 {
     $c = new ModelCriteria('bookstore', 'Propel\\Tests\\Bookstore\\Book');
     $c->distinct();
     $sql = 'SELECT DISTINCT  FROM ';
     $params = array();
     $this->assertCriteriaTranslation($c, $sql, $params, 'distinct() adds a DISTINCT clause');
 }
Exemplo n.º 2
0
 /**
  * @api
  *
  * @param \Propel\Runtime\ActiveQuery\ModelCriteria $query
  *
  * @return \Propel\Runtime\ActiveQuery\ModelCriteria
  */
 public function queryDistinctLocalesFromQuery(ModelCriteria $query)
 {
     $query->distinct('locale_name')->withColumn(SpyLocaleTableMap::COL_ID_LOCALE, 'value')->withColumn(SpyLocaleTableMap::COL_LOCALE_NAME, 'label');
     return $query;
 }