/** * 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); }
/** * 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; }