QueryExpression
class QueryExpression (View source)
Class QueryExpression
Methods
isExpression
buildExpression
getQuery
Concatenates an array of column names or values.
Concatenates an array of column names or values.
Gets the current date and time.
Used to get a string to extract year from date column.
Used to get a string to extract month from date column.
Used to get a string to extract day from date column.
Used to get a string to extract hour from date column.
Used to get a string to extract minute from date column.
Used to get a string to extract seconds from date column.
Get the length of a string in bytes.
Gets the number of characters in a string.
Casts a value to a char.
caseCondition
Details
at line line 28
__construct(QueryInterface $query)
at line line 40
static boolean
isExpression(string $value)
isExpression
at line line 52
mixed|QueryElement
buildExpression(string $name)
buildExpression
at line line 71
QueryInterface
getQuery()
getQuery
at line line 83
QueryExpression
setQuery(QueryInterface $query)
setQuery
at line line 103
string
concatenate(array $values, string $separator = null)
Concatenates an array of column names or values.
Usage: $query->select($query->concatenate(array('a', 'b')));
at line line 128
string
concat(array $values, string $separator = null)
Concatenates an array of column names or values.
Usage: $query->select($query->concatenate(array('a', 'b')));
at line line 140
string
current_timestamp()
Gets the current date and time.
at line line 157
string
year(string $date)
Used to get a string to extract year from date column.
Usage: $query->select($query->year($query->quoteName('dateColumn')));
at line line 174
string
month(string $date)
Used to get a string to extract month from date column.
Usage: $query->select($query->month($query->quoteName('dateColumn')));
at line line 191
string
day(string $date)
Used to get a string to extract day from date column.
Usage: $query->select($query->day($query->quoteName('dateColumn')));
at line line 208
string
hour(string $date)
Used to get a string to extract hour from date column.
Usage: $query->select($query->hour($query->quoteName('dateColumn')));
at line line 225
string
minute(string $date)
Used to get a string to extract minute from date column.
Usage: $query->select($query->minute($query->quoteName('dateColumn')));
at line line 242
string
second(string $date)
Used to get a string to extract seconds from date column.
Usage: $query->select($query->second($query->quoteName('dateColumn')));
at line line 261
integer
length(string $value)
Get the length of a string in bytes.
Note, use 'charLength' to find the number of characters in a string.
Usage: query->where($query->length('a').' > 3');
at line line 279
string
char_length(string $field, string $operator = null, string $condition = null)
Gets the number of characters in a string.
Note, use 'length' to find the number of bytes in a string.
at line line 295
string
cast_as_char(string $value)
Casts a value to a char.
Ensure that the value is properly quoted before passing to the method.
at line line 310
string
caseCondition(array $cases, string $else = null)
caseCondition