예제 #1
0
 /**
  * Cuenta los registros que coincidan con las condiciones indicadas
  *
  * @param  string $where  condiciones
  * @param  array  $values valores
  * @return int
  */
 public static function count($where = null, $values = null)
 {
     $source = static::getSource();
     $sql = QueryGenerator::count($source, $where);
     if ($values !== null && !is_array($values)) {
         $values = \array_slice(\func_get_args(), 1);
     }
     $sth = static::query($sql, $values);
     return $sth->fetch()->count;
 }