Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function buildSelectFoundRowsQuery(ISelectBuilder $query)
 {
     if ($query->getExecuted() && $query->getUseCalcFoundRows()) {
         return 'SELECT FOUND_ROWS()';
     }
     $distinctSql = $query->getDistinct() ? ' DISTINCT' : '';
     return 'SELECT count(*) FROM (SELECT' . $distinctSql . ' ' . $this->buildSelectQueryBody($query) . ') AS `mainQuery`';
 }