Yii Advanced Filters Extension
  • Package
  • Class

Packages

  • advancedfilters
    • components
    • dbhelpers
    • filters

Classes

  • AfBaseDbHelper
  • AfMssql2012DbHelper
  • AfMssqlDbHelper
  • AfMysqlDbHelper

Class AfBaseDbHelper

The base class for all advanced filter database helpers.

The methods in this class are used by filters to add database specific syntax to conditions.

The base class provides default functionality for database operations where the syntax is common amongst multiple databases, and abstract methods that must be overridden where the syntax is database specific.

CComponent
Extended by AfBaseDbHelper

Direct known subclasses

AfMssqlDbHelper, AfMysqlDbHelper

Indirect known subclasses

AfMssql2012DbHelper

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

Methods summary

public string
# convertNullToEmptyString( string $dbExpression )

Alters a database expression so that null values are converted to an empty string. Override this method in child classes if the database uses different syntax.

Alters a database expression so that null values are converted to an empty string. Override this method in child classes if the database uses different syntax.

Parameters

$dbExpression
the expression to update.

Returns

string
the updated expression.
public string
# convertEmptyStringToNull( string $dbExpression )

Alters a database expression so that empty strings are converted to null. Override this method in child classes if the database uses different syntax.

Alters a database expression so that empty strings are converted to null. Override this method in child classes if the database uses different syntax.

Parameters

$dbExpression
the expression to update.

Returns

string
the updated expression.
abstract public string
# convertExpressionToDecimal( string $dbExpression, integer $numDigits, integer $decimalPlaces, integer $nonNumericResultValue )

Alters a database expression so that strings are converted to decimals.

Alters a database expression so that strings are converted to decimals.

Values that can't be converted are set to the specific non-numeric result value, which should be an integer or null.

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.
abstract public boolean
# checkRegex( CDbConnection $dbConnection, string $regex )

Verifies that the provided pattern is syntactically valid for the specific database. This may require a test query to be run. No default implementation is provided as each database uses its own syntax.

Verifies that the provided pattern is syntactically valid for the specific database. This may require a test query to be run. No default implementation is provided as each database uses its own syntax.

Parameters

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

Returns

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

Adds a regular expression condition to the provided criteria. No default implementation is provided as each database uses its own syntax.

Adds a regular expression condition to the provided criteria. No default implementation is provided as each database uses its own syntax.

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.

Magic methods summary

Yii Advanced Filters Extension API documentation generated by ApiGen