Yii Advanced Filters Extension
  • Package
  • Class

Packages

  • advancedfilters
    • components
    • dbhelpers
    • filters

Classes

  • AfBaseDbHelper
  • AfMssql2012DbHelper
  • AfMssqlDbHelper
  • AfMysqlDbHelper

Class AfMysqlDbHelper

A generic database helper for MySQL.

CComponent
Extended by AfBaseDbHelper
Extended by AfMysqlDbHelper
Package: advancedfilters\dbhelpers
Author: Keith Burton kburton@kappasoft.net
Located at dbhelpers/AfMysqlDbHelper.php

Methods summary

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

Checks regular expression syntax using the REGEXP keyword. Documentation for this syntax can be found on the MySQL website.

Checks regular expression syntax using the REGEXP keyword. Documentation for this syntax can be found on the MySQL website.

This is checked against the database, as invalid syntax could otherwise cause an exception to be thrown when the data is fetched.

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 REGEXP keyword. Documentation for this syntax can be found on the MySQL website.

Adds a regex condition using the REGEXP keyword. Documentation for this syntax can be found on the MySQL website.

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