Expression
class Expression extends Component (View source)
Parses a reference to an expression (column, table or database name, function call, mathematical expression, etc.).
Properties
string | $database | The name of this database. |
|
string | $table | The name of this table. |
|
string | $column | The name of the column. |
|
string | $expr | The sub-expression. |
|
string | $alias | The alias of this expression. |
|
mixed | $function | The name of the function. |
|
string | $subquery | The type of subquery. |
Methods
No description
Syntax: new Expression('expr') new Expression('expr', 'alias') new Expression('database', 'table', 'column') new Expression('database', 'table', 'column', 'alias')
Details
static mixed
parse(Parser $parser, TokensList $list, array $options = [])
Possible options:.
field
First field to be filled.
If this is not specified, it takes the value of `parseField`.
parseField
Specifies the type of the field parsed. It may be `database`,
`table` or `column`. These expressions may not include
parentheses.
breakOnAlias
If not empty, breaks when the alias occurs (it is not included).
breakOnParentheses
If not empty, breaks when the first parentheses occurs.
parenthesesDelimited
If not empty, breaks after last parentheses occurred.
static mixed
build(mixed $component, array $options = [])
No description
string
__toString()
Builds the string representation of a component of this type.
__construct(string $database = null, string $table = null, string $column = null, string $alias = null)
Syntax: new Expression('expr') new Expression('expr', 'alias') new Expression('database', 'table', 'column') new Expression('database', 'table', 'column', 'alias')
If the database, table or column name is not required, pass an empty string.