MediaWiki master
Wikimedia\Rdbms\Expression Class Reference

A composite leaf representing an expression. More...

Inherits Wikimedia\Rdbms\IExpression.

Inherited by Wikimedia\Rdbms\RawSQLExpression.

Collaboration diagram for Wikimedia\Rdbms\Expression:

Public Member Functions

 __construct (string $field, string $op, $value)
 Store an expression.
 
 and (string $field, string $op, $value)
 
 andExpr (IExpression $expr)
 
 or (string $field, string $op, $value)
 
 orExpr (IExpression $expr)
 
 toGeneralizedSql ()
 
 toSql (DbQuoter $dbQuoter)
 

Additional Inherited Members

- Public Attributes inherited from Wikimedia\Rdbms\IExpression
const ACCEPTABLE_OPERATORS = [ '>', '<', '!=', '=', '>=', '<=', self::LIKE, self::NOT_LIKE ]
 
const LIKE = 'LIKE'
 
const NOT_LIKE = 'NOT LIKE'
 

Detailed Description

A composite leaf representing an expression.

Since
1.42

Definition at line 14 of file Expression.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\Expression::__construct ( string $field,
string $op,
$value )

Store an expression.

Parameters
string$field
string$opOne of '>', '<', '!=', '=', '>=', '<=', IExpression::LIKE, IExpression::NOT_LIKE
?scalar|RawSQLValue|Blob|LikeValue|non-empty-list<scalar|Blob>$value
Access: internal
Outside of rdbms, Use IReadableDatabase::expr() to create an expression object.

Definition at line 31 of file Expression.php.

References Wikimedia\Rdbms\IExpression\ACCEPTABLE_OPERATORS, Wikimedia\Rdbms\IExpression\LIKE, and Wikimedia\Rdbms\IExpression\NOT_LIKE.

Member Function Documentation

◆ and()

Wikimedia\Rdbms\Expression::and ( string $field,
string $op,
$value )
Parameters
string$field
string$opOne of '>', '<', '!=', '=', '>=', '<=', IExpression::LIKE, IExpression::NOT_LIKE
?scalar|RawSQLValue|Blob|LikeValue|non-empty-list<scalar|Blob>$value

Definition at line 78 of file Expression.php.

◆ andExpr()

Wikimedia\Rdbms\Expression::andExpr ( IExpression $expr)
Parameters
IExpression$expr
Returns
AndExpressionGroup

Definition at line 103 of file Expression.php.

◆ or()

Wikimedia\Rdbms\Expression::or ( string $field,
string $op,
$value )
Parameters
string$field
string$opOne of '>', '<', '!=', '=', '>=', '<=', IExpression::LIKE, IExpression::NOT_LIKE
?scalar|RawSQLValue|Blob|LikeValue|non-empty-list<scalar|Blob>$value

Definition at line 93 of file Expression.php.

◆ orExpr()

Wikimedia\Rdbms\Expression::orExpr ( IExpression $expr)
Parameters
IExpression$expr
Returns
OrExpressionGroup

Definition at line 113 of file Expression.php.

◆ toGeneralizedSql()

Wikimedia\Rdbms\Expression::toGeneralizedSql ( )
Access: internal
to be used by rdbms library only

Implements Wikimedia\Rdbms\IExpression.

Reimplemented in Wikimedia\Rdbms\RawSQLExpression.

Definition at line 162 of file Expression.php.

◆ toSql()

Wikimedia\Rdbms\Expression::toSql ( DbQuoter $dbQuoter)
Access: internal
to be used by rdbms library only

Implements Wikimedia\Rdbms\IExpression.

Reimplemented in Wikimedia\Rdbms\RawSQLExpression.

Definition at line 122 of file Expression.php.

References Wikimedia\Rdbms\Database\DbQuoter\addQuotes().


The documentation for this class was generated from the following file: