Pt_BR En Ja De Fr 
You are currently viewing the 0.10 branch api documentation. Switch to 1.0 or 1.1

0.10 Doctrine_Expression_Driver

Doctrine Expression Driver

Inheritence

Doctrine_Expression_Driver  < Doctrine_Connection_Module

Direct Sub-Classes

Method Summary

Returns Name Description
string acos
string add add() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions. Example:

expr;

 $q->select('u.*')
   ->from('Use
string avg
string between 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
concat concat() accepts an arbitrary number of parameters. Each parameter must contain an expression or an array with expressions.
cos
string count If a '*' is used instead of a column the number of selected rows is returned.
string div divide() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions. Example:

expr;

 $q->select('u.*')
   ->from('
string eq Example:

select('u.*')
   ->from('User u')
   ->where($q->expr->eq('id', 1));]]>
   
getIdentifier
getIdentifiers
string gt Example:

select('u.*')
   ->from('User u')
   ->where($q->expr->gt('id', 1));]]>
   
string gte Example:

select('u.*')
   ->from('User u')
   ->where($q->expr->gte('id', 1));]]>
   
string guid
string in 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 again
string isNotNull Example:

select('u.*')
   ->from('User u')
   ->where($q->expr->isNotNull('id'));]]>
   
string isNull Example:

select('u.*')
   ->from('User u')
   ->where($q->expr->isNull('id'));]]>
   
string length
integer locate
string lower
string lt Example:

select('u.*')
   ->from('User u')
   ->where($q->expr->lt('id', 1));]]>
   
string lte Example:

select('u.*')
   ->from('User u')
   ->where($q->expr->lte('id', 1));]]>
   
string ltrim
string max
string md5 Note: Not SQL92, but common functionality
string min
string mod
string mul multiply() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions. Example:

expr;

 $q->select('u.*')
   ->from
string neq Example:

select('u.*')
   ->from('User u')
   ->where($q->expr->neq('id', 1));]]>
   
string not Example:

expr;
 $q->select('*')->from('table')
   ->where($e->eq('id', $e->not('null'));]]>
   
string now
pi
string regexp
string round
string rtrim
sin
string soundex The string "?000" is returned if the argument is NULL.
string sub subtract() accepts an arbitrary number of parameters. Each parameter must contain a value or an expression or an array with values or expressions. Example:

expr;

 $q->select('u.*')
   ->from
string substring Note: Not SQL92, but common functionality. SQLite only supports the 2 parameter variant of this function
string sum
string trim
string upper
__call for all native RDBMS functions the function name itself is returned

Method Details

  • (string) acos($value)

    returns arcus cosine SQL string


  • (string) add($args)

    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('Use

    Doctrine_Expression_Driver


  • $column the column to use

    (string) avg($column)

    Returns the average value of a column

    Doctrine_Expression_Driver


  • $expression the value to compare to
    $value1 the lower value to compare with
    $value2 the higher value to compare with

    (string) between($expression, $value1, $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

    Doctrine_Expression_Driver


  • 0 strings that will be concatinated.

    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.


  • cos($value)


  • $column the column to use

    (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.

    Doctrine_Expression_Driver


  • (string) div($args)

    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('

    Doctrine_Expression_Driver


  • $value1 logical expression to compare
    $value2 logical expression to compare with

    (string) eq($value1, $value2)

    Returns the SQL to check if two values are equal.

    Example:

    
    
    $q->select('u.*')
    ->from('User u')
    ->where($q->expr->eq('id', 1));]]>

    Doctrine_Expression_Driver


  • getIdentifier($column)


  • getIdentifiers($columns)


  • $value1 logical expression to compare
    $value2 logical expression to compare with

    (string) gt($value1, $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));]]>

    Doctrine_Expression_Driver


  • $value1 logical expression to compare
    $value2 logical expression to compare with

    (string) gte($value1, $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));]]>

    Doctrine_Expression_Driver


  • (string) guid()

    Returns global unique identifier

    Doctrine_Expression_Driver


  • $column the value that should be matched against
    $values values that will be matched against $column

    (string) in($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 again

    Doctrine_Expression_Driver


  • $expression the expression that should be compared to null

    (string) isNotNull($expression)

    Returns SQL that checks if a expression is not null.

    Example:

    
    
    $q->select('u.*')
    ->from('User u')
    ->where($q->expr->isNotNull('id'));]]>

    Doctrine_Expression_Driver


  • $expression the expression that should be compared to null

    (string) isNull($expression)

    Returns SQL that checks if a expression is null.

    Example:

    
    
    $q->select('u.*')
    ->from('User u')
    ->where($q->expr->isNull('id'));]]>

    Doctrine_Expression_Driver


  • (string) length($column, $expression1, $expression2)

    Returns the length of a text field.


  • $str literal string
    $substr literal string to find

    (integer) locate($str, $substr)

    locate returns the position of the first occurrence of substring $substr in string $str


  • $str literal string or column name

    (string) lower($str)

    lower Returns the string $str with all characters changed to lowercase according to the current character set mapping.


  • $value1 logical expression to compare
    $value2 logical expression to compare with

    (string) lt($value1, $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));]]>

    Doctrine_Expression_Driver


  • $value1 logical expression to compare
    $value2 logical expression to compare with

    (string) lte($value1, $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));]]>

    Doctrine_Expression_Driver


  • $str literal string or column name

    (string) ltrim($str)

    ltrim returns the string $str with leading space characters removed


  • $column the column to use

    (string) max($column)

    Returns the highest value of a column

    Doctrine_Expression_Driver


  • (string) md5($column)

    Returns the md5 sum of a field.

    Note: Not SQL92, but common functionality


  • $column the column to use

    (string) min($column)

    Returns the lowest value of a column


  • (string) mod($expression1, $expression2)

    Returns the remainder of the division operation $expression1 / $expression2.


  • (string) mul($args)

    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

    Doctrine_Expression_Driver


  • $value1 logical expression to compare
    $value2 logical expression to compare with

    (string) neq($value1, $value2)

    Returns the SQL to check if two values are unequal.

    Example:

    
    
    $q->select('u.*')
    ->from('User u')
    ->where($q->expr->neq('id', 1));]]>

    Doctrine_Expression_Driver


  • (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'));]]>

    Doctrine_Expression_Driver


  • (string) now()

    Returns the current system date.


  • pi()


  • (string) regexp()

    regexp returns the regular expression operator


  • (string) round($column, $decimals, $expression1, $expression2)

    Rounds a numeric field to the number of decimals specified.


  • $str literal string or column name

    (string) rtrim($str)

    rtrim returns the string $str with proceeding space characters removed


  • sin($value)


  • (string) soundex($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.

    Doctrine_Expression_Driver


  • (string) sub($args)

    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

    Doctrine_Expression_Driver


  • $value an sql string literal or column name/alias
    $position where to start the substring portion
    $length the substring portion length

    (string) substring($value, $from, $len = null, $position, $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

    Doctrine_Expression_Driver


  • $column the column to use

    (string) sum($column)

    Returns the total sum of a column


  • $str literal string or column name

    (string) trim($str)

    trim returns the string $str with leading and proceeding space characters removed


  • $str literal string or column name

    (string) upper($str)

    upper Returns the string $str with all characters changed to uppercase according to the current character set mapping.


  • __call($m, $a)

    for all native RDBMS functions the function name itself is returned


Comments (0) [ add comment ]

 No Comments

Add Comment

Add New Comment
Please enter follow the doctrine