Ejemplo n.º 1
0
 /**
  * Build a query based on the given options to count the number of records
  *
  * @param array $arrOptions The options array
  *
  * @return string The query string
  */
 protected static function buildCountQuery(array $arrOptions)
 {
     return \Model\QueryBuilder::count($arrOptions);
 }
Ejemplo n.º 2
0
 /**
  * Return the number of records matching certain criteria
  * 
  * @param mixed $strColumn An optional property name
  * @param mixed $varValue  An optional property value
  * 
  * @return integer The number of matching rows
  */
 public static function countBy($strColumn = null, $varValue = null)
 {
     if (static::$strTable == '') {
         return 0;
     }
     $strQuery = \Model\QueryBuilder::count(array('table' => static::$strTable, 'column' => $strColumn, 'value' => $varValue));
     return \Database::getInstance()->prepare($strQuery)->execute($varValue)->count;
 }