Yii Advanced Filters Extension
  • Package
  • Class

Packages

  • advancedfilters
    • components
    • dbhelpers
    • filters

Classes

  • AfBaseDbHelper
  • AfMssql2012DbHelper
  • AfMssqlDbHelper
  • AfMysqlDbHelper

Class AfMssqlDbHelper

A generic database helper for SQL Server. If you are using an SQL Server version of 2012 or later, you should instead use the more robust AfMssql2012DbHelper class, by overriding the $driverMap property in the configuration of the advanced filters extension.

CComponent
Extended by AfBaseDbHelper
Extended by AfMssqlDbHelper

Direct known subclasses

AfMssql2012DbHelper

Package: advancedfilters\dbhelpers
Author: Keith Burton kburton@kappasoft.net
Located at dbhelpers/AfMssqlDbHelper.php

Methods summary

public string
# convertExpressionToDecimal( string $dbExpression, integer $numDigits, integer $decimalPlaces, integer $nonNumericResultValue )

Provides conversion to decimal for SQL Server versions earlier than 2012.

Provides conversion to decimal for SQL Server versions earlier than 2012.

SQL Server stops processing records as soon as it hits an invalid cast. To support older versions of SQL Server, this implementation checks the value length and uses ISNUMERIC rather than the more reliable TRY_CAST function. If you're using SQL Server 2012 or later, you should use the AfMssql2012DbHelper class instead.

Parameters

$dbExpression
the expression to update.
$numDigits

the maximum number of digits that the decimal number should contain.

$decimalPlaces

the number of decimal places that the resulting decimal should have.

$nonNumericResultValue

the integer value to use if an expression isn't recognised as a number. This can also be null.

Returns

string
the updated expression.
public boolean
# checkRegex( CDbConnection $dbConnection, string $regex )

Checks regular expression syntax using the very limited PATINDEX function. Documentation for this function's syntax can be found on MSDN.

Checks regular expression syntax using the very limited PATINDEX function. Documentation for this function's syntax can be found on MSDN.

It makes use of wildcards, so, assuming the extension is configured to use the default regex prefix and suffix, patterns might look like this:

/%[0-9]%/ The value contains a number. /[0-9]%/ The value starts with a number. /%[0-9]/ The value ends with a number.

Parameters

$dbConnection
the database connection object.
$regex
the pattern to test.

Returns

boolean
true if the syntax is valid, false if not.
public
# addRegexCondition( CDbCriteria $criteria, string $columnExpression, string $regex, boolean $invertLogic )

Adds a regex condition using the very limited PATINDEX function. Documentation for this function's syntax can be found on MSDN.

Adds a regex condition using the very limited PATINDEX function. Documentation for this function's syntax can be found on MSDN.

It makes use of wildcards, so, assuming the extension is configured to use the default regex prefix and suffix, patterns might look like this:

/%[0-9]%/ The value contains a number. /[0-9]%/ The value starts with a number. /%[0-9]/ The value ends with a number.

Parameters

$criteria
the criteria to update.
$columnExpression

the column to search, or a valid expression.

$regex
the pattern to match against.
$invertLogic

whether the logic should be inverted to return the opposite query results.

Methods inherited from AfBaseDbHelper

convertEmptyStringToNull(), convertNullToEmptyString()

Magic methods summary

Yii Advanced Filters Extension API documentation generated by ApiGen