returns arcus cosine SQL string
Parameters:
API Tags:
Returns the SQL to add values or expressions together.
add() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
Example:
$e = $q->expr;
$q->select('u.*')
->from('User u')
->where($e->eq($e->add('id', 2), 12));
Parameters:
string|array(string) |
$args: |
|
API Tags:
Return: | an expression |
Access: | public |
string avg(
string
$column
)
|
|
Returns the average value of a column
Parameters:
string |
$column: |
the column to use |
API Tags:
Return: | generated sql including an AVG aggregate function |
Access: | public |
string basicMath(
string
$type,
$args
)
|
|
Returns the SQL to perform the same mathematical operation over an array of values or expressions.
basicMath() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
Parameters:
string |
$type: |
the type of operation, can be '+', '-', '*' or '/'. |
string|array(string) |
$args: |
|
API Tags:
Return: | an expression |
Access: | private |
string between(
string
$expression, string
$value1, string
$value2
)
|
|
Returns SQL that checks if an expression evaluates to a value between two values.
The parameter $expression is checked if it is between $value1 and $value2.
Note: There is a slight difference in the way BETWEEN works on some databases. http://www.w3schools.com/sql/sql_between.asp. If you want complete database independence you should avoid using between().
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->between('id', 1, 5));
Parameters:
string |
$expression: |
the value to compare to |
string |
$value1: |
the lower value to compare with |
string |
$value2: |
the higher value to compare with |
API Tags:
Return: | logical expression |
Access: | public |
void concat(
string|array(string)
0
)
|
|
Returns a series of strings concatinated
concat() accepts an arbitrary number of parameters. Each parameter must contain an expression or an array with expressions.
Parameters:
string|array(string) |
0: |
strings that will be concatinated. |
API Tags:
Redefined in descendants as:
string count(
string|integer
$column
)
|
|
Returns the number of rows (without a NULL value) of a column
If a '*' is used instead of a column the number of selected rows is returned.
Parameters:
string|integer |
$column: |
the column to use |
API Tags:
Return: | generated sql including a COUNT aggregate function |
Access: | public |
Returns the SQL to divide values or expressions by eachother.
divide() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
Example:
$e = $q->expr;
$q->select('u.*')
->from('User u')
->where($e->eq($e->div('id', 2), 12));
Parameters:
string|array(string) |
$args: |
|
API Tags:
Return: | an expression |
Access: | public |
string eq(
string
$value1, string
$value2
)
|
|
Returns the SQL to check if two values are equal.
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->eq('id', 1));
Parameters:
string |
$value1: |
logical expression to compare |
string |
$value2: |
logical expression to compare with |
API Tags:
Return: | logical expression |
Access: | public |
void getIdentifier(
$column
)
|
|
Parameters:
API Tags:
void getIdentifiers(
$columns
)
|
|
Parameters:
API Tags:
string gt(
string
$value1, string
$value2
)
|
|
Returns the SQL to check if one value is greater than another value.
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->gt('id', 1));
Parameters:
string |
$value1: |
logical expression to compare |
string |
$value2: |
logical expression to compare with |
API Tags:
Return: | logical expression |
Access: | public |
string gte(
string
$value1, string
$value2
)
|
|
Returns the SQL to check if one value is greater than or equal to another value.
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->gte('id', 1));
Parameters:
string |
$value1: |
logical expression to compare |
string |
$value2: |
logical expression to compare with |
API Tags:
Return: | logical expression |
Access: | public |
Returns global unique identifier
API Tags:
Return: | to get global unique identifier |
Access: | public |
Redefined in descendants as:
string in(
string
$column, string|array(string)
$values
)
|
|
Returns the SQL to check if a value is one in a set of given values..
in() accepts an arbitrary number of parameters. The first parameter must always specify the value that should be matched against. Successive must contain a logical expression or an array with logical expressions. These expressions will be matched against the first parameter.
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->in( 'id', array(1,2,3)));
Parameters:
string |
$column: |
the value that should be matched against |
string|array(string) |
$values: |
values that will be matched against $column |
API Tags:
Return: | logical expression |
Access: | public |
string isNotNull(
string
$expression
)
|
|
Returns SQL that checks if a expression is not null.
Example:
$q->select('u.*')
->from('User u')
Parameters:
string |
$expression: |
the expression that should be compared to null |
API Tags:
Return: | logical expression |
Access: | public |
string isNull(
string
$expression
)
|
|
Returns SQL that checks if a expression is null.
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->isNull('id'));
Parameters:
string |
$expression: |
the expression that should be compared to null |
API Tags:
Return: | logical expression |
Access: | public |
string length(
$column, string
$expression1, string
$expression2
)
|
|
Returns the length of a text field.
Parameters:
string |
$expression1: |
|
string |
$expression2: |
|
|
$column: |
|
API Tags:
integer locate(
string
$str, string
$substr
)
|
|
locate returns the position of the first occurrence of substring $substr in string $str
Parameters:
string |
$substr: |
literal string to find |
string |
$str: |
literal string |
API Tags:
string lower(
string
$str
)
|
|
lower Returns the string $str with all characters changed to lowercase according to the current character set mapping.
Parameters:
string |
$str: |
literal string or column name |
API Tags:
string lt(
string
$value1, string
$value2
)
|
|
Returns the SQL to check if one value is less than another value.
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->lt('id', 1));
Parameters:
string |
$value1: |
logical expression to compare |
string |
$value2: |
logical expression to compare with |
API Tags:
Return: | logical expression |
Access: | public |
string lte(
string
$value1, string
$value2
)
|
|
Returns the SQL to check if one value is less than or equal to another value.
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->lte('id', 1));
Parameters:
string |
$value1: |
logical expression to compare |
string |
$value2: |
logical expression to compare with |
API Tags:
Return: | logical expression |
Access: | public |
string ltrim(
string
$str
)
|
|
ltrim returns the string $str with leading space characters removed
Parameters:
string |
$str: |
literal string or column name |
API Tags:
string max(
string
$column
)
|
|
Returns the highest value of a column
Parameters:
string |
$column: |
the column to use |
API Tags:
Return: | generated sql including a MAX aggregate function |
Access: | public |
Returns the md5 sum of a field.
Note: Not SQL92, but common functionality
Parameters:
API Tags:
Redefined in descendants as:
string min(
string
$column
)
|
|
Returns the lowest value of a column
Parameters:
string |
$column: |
the column to use |
API Tags:
string mod(
string
$expression1, string
$expression2
)
|
|
Returns the remainder of the division operation $expression1 / $expression2.
Parameters:
string |
$expression1: |
|
string |
$expression2: |
|
API Tags:
Returns the SQL to multiply values or expressions by eachother.
multiply() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
Example:
$e = $q->expr;
$q->select('u.*')
->from('User u')
->where($e->eq($e->mul('id', 2), 12));
Parameters:
string|array(string) |
$args: |
|
API Tags:
Return: | an expression |
Access: | public |
string neq(
string
$value1, string
$value2
)
|
|
Returns the SQL to check if two values are unequal.
Example:
$q->select('u.*')
->from('User u')
->where($q->expr->neq('id', 1));
Parameters:
string |
$value1: |
logical expression to compare |
string |
$value2: |
logical expression to compare with |
API Tags:
Return: | logical expression |
Access: | public |
string not(
$expression
)
|
|
Returns the SQL for a logical not.
Example:
$e = $q->expr;
$q->select('*')->from('table')
->where($e->eq('id', $e->not('null'));
Parameters:
API Tags:
Return: | a logical expression |
Access: | public |
Returns the current system date.
API Tags:
Redefined in descendants as:
regexp returns the regular expression operator
API Tags:
Redefined in descendants as:
string round(
$column, [
$decimals = 0], string
$expression1, string
$expression2
)
|
|
Rounds a numeric field to the number of decimals specified.
Parameters:
string |
$expression1: |
|
string |
$expression2: |
|
|
$column: |
|
|
$decimals: |
|
API Tags:
string rtrim(
string
$str
)
|
|
rtrim returns the string $str with proceeding space characters removed
Parameters:
string |
$str: |
literal string or column name |
API Tags:
string soundex(
string
$value
)
|
|
soundex Returns a string to call a function to compute the soundex encoding of a string
The string "?000" is returned if the argument is NULL.
Parameters:
API Tags:
Return: | SQL soundex function with given parameter |
Access: | public |
Redefined in descendants as:
Returns the SQL to subtract values or expressions from eachother.
subtract() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions.
Example:
$e = $q->expr;
$q->select('u.*')
->from('User u')
->where($e->eq($e->sub('id', 2), 12));
Parameters:
string|array(string) |
$args: |
|
API Tags:
Return: | an expression |
Access: | public |
string substring(
string
$value,
$from, [
$len = null], integer
$position, integer
$length
)
|
|
return string to call a function to get a substring inside an SQL statement
Note: Not SQL92, but common functionality.
SQLite only supports the 2 parameter variant of this function
Parameters:
string |
$value: |
an sql string literal or column name/alias |
integer |
$position: |
where to start the substring portion |
integer |
$length: |
the substring portion length |
|
$from: |
|
|
$len: |
|
API Tags:
Return: | SQL substring function with given parameters |
Access: | public |
Redefined in descendants as:
string sum(
string
$column
)
|
|
Returns the total sum of a column
Parameters:
string |
$column: |
the column to use |
API Tags:
string trim(
string
$str
)
|
|
trim returns the string $str with leading and proceeding space characters removed
Parameters:
string |
$str: |
literal string or column name |
API Tags:
string upper(
string
$str
)
|
|
upper Returns the string $str with all characters changed to uppercase according to the current character set mapping.
Parameters:
string |
$str: |
literal string or column name |
API Tags:
__call
for all native RDBMS functions the function name itself is returned
Parameters:
API Tags: