HumHub Documentation (unofficial)

SimpleCondition
in package
implements ConditionInterface

Class SimpleCondition represents a simple condition like `"column" operator value`.

Tags
author

Dmytro Naumenko d.naumenko.a@gmail.com

since
2.0.14
phpcs:disable

Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore

Table of Contents

Interfaces

ConditionInterface
Interface ConditionInterface should be implemented by classes that represent a condition in DBAL of framework.

Properties

$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
getOperator()  : string
getValue()  : mixed

Properties

$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(mixed $column, string $operator, mixed $value) : mixed
Parameters
$column : mixed

the literal to the left of $operator

$operator : string

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

$value : mixed

the literal to the right of $operator

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

        
On this page

Search results