Contao\Model::countBy PHP Метод

countBy() публичный статический Метод

Return the number of records matching certain criteria
public static countBy ( mixed $strColumn = null, mixed $varValue = null, array $arrOptions = [] ) : integer
$strColumn mixed An optional property name
$varValue mixed An optional property value
$arrOptions array An optional options array
Результат integer The number of matching rows
    public static function countBy($strColumn = null, $varValue = null, array $arrOptions = array())
    {
        if (static::$strTable == '') {
            return 0;
        }
        $arrOptions = array_merge(array('table' => static::$strTable, 'column' => $strColumn, 'value' => $varValue), $arrOptions);
        $strQuery = static::buildCountQuery($arrOptions);
        return (int) \Database::getInstance()->prepare($strQuery)->execute($arrOptions['value'])->count;
    }