HumHub Documentation (unofficial)

LikeCondition extends SimpleCondition
in package

Class LikeCondition represents a `LIKE` condition.

Tags
author

Dmytro Naumenko d.naumenko.a@gmail.com

since
2.0.14

Table of Contents

Properties

$escapingReplacements  : array<string|int, mixed>|null|false
$column  : mixed
$operator  : string
$value  : mixed

Methods

__construct()  : mixed
SimpleCondition constructor
fromArrayDefinition()  : $this
Creates object by array-definition as described in [Query Builder – Operator format](guide:db-query-builder#operator-format) guide article.
getColumn()  : mixed
getEscapingReplacements()  : array<string|int, mixed>|null|false
getOperator()  : string
getValue()  : mixed
setEscapingReplacements()  : mixed
This method allows to specify how to escape special characters in the value(s).

Properties

$escapingReplacements

protected array<string|int, mixed>|null|false $escapingReplacements

map of chars to their replacements, false if characters should not be escaped or either null or empty array if escaping is condition builder responsibility. By default it's set to null.

$column

private mixed $column

the column name to the left of [[operator]]

$operator

private string $operator

the operator to use. Anything could be used e.g. >, <=, etc.

$value

private mixed $value

the value to the right of the [[operator]]

Methods

__construct()

SimpleCondition constructor

public __construct(string $column, string $operator, array<string|int, string>|string $value) : mixed
Parameters
$column : string

the column name.

$operator : string

the operator to use (e.g. LIKE, NOT LIKE, OR LIKE or OR NOT LIKE)

$value : array<string|int, string>|string

single value or an array of values that $column should be compared with. If it is an empty array the generated expression will be a false value if operator is LIKE or OR LIKE and empty if operator is NOT LIKE or OR NOT LIKE.

fromArrayDefinition()

Creates object by array-definition as described in [Query Builder – Operator format](guide:db-query-builder#operator-format) guide article.

public static fromArrayDefinition(mixed $operator, mixed $operands) : $this
Parameters
$operator : mixed

operator in uppercase.

$operands : mixed

array of corresponding operands

Tags
throws
InvalidArgumentException

if wrong number of operands have been given.

Return values
$this

getEscapingReplacements()

public getEscapingReplacements() : array<string|int, mixed>|null|false
Return values
array<string|int, mixed>|null|false

setEscapingReplacements()

This method allows to specify how to escape special characters in the value(s).

public setEscapingReplacements(mixed $escapingReplacements) : mixed
Parameters
$escapingReplacements : mixed

        
On this page

Search results