1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс ConditionTree

Открытые члены

 __construct ()
 logic ($logic=null)
 negative ($negative=true)
 where (... $filter)
 whereNot (... $filter)
 whereColumn (... $filter)
 whereNull ($column)
 whereNotNull ($column)
 whereIn ($column, $values)
 whereNotIn ($column, $values)
 whereBetween ($column, $valueMin, $valueMax)
 whereNotBetween ($column, $valueMin, $valueMax)
 whereLike ($column, $value)
 whereNotLike ($column, $value)
 whereExists ($query)
 whereNotExists ($query)
 whereMatch ($column, $value)
 whereNotMatch ($column, $value)
 whereExpr ($expr, $arguments)
 getConditions ()
 addCondition ($condition)
 hasConditions ()
 replaceCondition ($currentCondition, $newCondition)
 removeCondition ($condition)
 removeAllConditions ()
 __clone ()

Открытые статические члены

static createFromArray ($filter)

Поля данных

const LOGIC_OR = 'or'
const LOGIC_AND = 'and'

Защищенные члены

 convertValues ($values, IReadable $field=null)

Защищенные статические члены

static getRandomSequence ()

Защищенные данные

 $chains
 $conditions = array()
 $logic
 $isNegative = false

Статические защищенные данные

static RandomSequence $randomSequence

Подробное описание

См. определение в файле conditiontree.php строка 28

Конструктор(ы)

◆ __construct()

__construct ( )

ConditionTree constructor.

См. определение в файле conditiontree.php строка 58

Методы

◆ __clone()

__clone ( )

См. определение в файле conditiontree.php строка 720

◆ addCondition()

addCondition ( $condition)

Adds prepared condition.

Аргументы
Condition | ConditionTree$condition
Возвращает
$this
Исключения
ArgumentException

См. определение в файле conditiontree.php строка 575

◆ convertValues()

convertValues ( $values,
IReadable $field = null )
protected

Converts array of values to raw SQL.

См. также
ConditionTree::convertValue()
Аргументы
array$values
\Bitrix\Main\ORM\Fields\IReadable | null$field
Возвращает
array
Исключения
ArgumentException
SystemException

См. определение в файле conditiontree.php строка 710

◆ createFromArray()

createFromArray ( $filter)
static

Creates filter object from array

Аргументы
$filter
Возвращает
ConditionTree
Исключения
ArgumentException

См. определение в файле conditiontree.php строка 753

◆ getConditions()

getConditions ( )

Returns all conditions and subfilters.

Возвращает
ConditionTree[]|Condition[]

См. определение в файле conditiontree.php строка 562

◆ getRandomSequence()

getRandomSequence ( )
staticprotected
Возвращает
RandomSequence

См. определение в файле conditiontree.php строка 735

◆ hasConditions()

hasConditions ( )

Checks if filter is not empty.

Возвращает
bool

См. определение в файле conditiontree.php строка 591

◆ logic()

logic ( $logic = null)

All conditions will be imploded by this logic: static::LOGIC_AND or static::LOGIC_OR

Аргументы
string$logicand|or
Возвращает
$this|string
Исключения
ArgumentException

См. определение в файле conditiontree.php строка 71

◆ negative()

negative ( $negative = true)

Sets NOT before all the conditions.

Аргументы
bool$negative
Возвращает
$this

См. определение в файле conditiontree.php строка 95

◆ removeAllConditions()

removeAllConditions ( )

Removes all conditions

См. определение в файле conditiontree.php строка 642

◆ removeCondition()

removeCondition ( $condition)

Removes one condition

Аргументы
$condition
Возвращает
bool

См. определение в файле conditiontree.php строка 625

◆ replaceCondition()

replaceCondition ( $currentCondition,
$newCondition )

Replaces condition with a new one.

Аргументы
$currentCondition
$newCondition
Возвращает
bool

См. определение в файле conditiontree.php строка 604

◆ where()

where ( ...)

General condition. In regular case used with 3 parameters: where(columnName, operator, value), e.g. ('ID', '=', 1); ('SALARY', '>', '500')

List of available operators can be found in Operator class.

См. также
Operator::$operators

Can be used in short format: where(columnName, value), with operator '=' by default Can be used in ultra short format: where(columnName), for boolean fields only

Can be used for subfilter set: where(ConditionTree subfilter)

Instead of columnName, you can use runtime field: where(new ExpressionField('TMP', 'CONCAT(s, s)', ["NAME", "LAST_NAME"]), 'Anton Ivanov') or with expr helper where(Query::expr()->concat("NAME", "LAST_NAME"), 'Anton Ivanov')

Аргументы
mixed...$filter
Возвращает
$this
Исключения
ArgumentException

См. определение в файле conditiontree.php строка 126

◆ whereBetween()

whereBetween ( $column,
$valueMin,
$valueMax )

BETWEEN condition.

Аргументы
$column
$valueMin
$valueMax
Возвращает
$this

См. определение в файле conditiontree.php строка 313

◆ whereColumn()

whereColumn ( ...)

The same logic as where(), but value will be taken as another column name.

См. также
ConditionTree::where()
Аргументы
mixed...$filter
Возвращает
$this
Исключения
ArgumentException

См. определение в файле conditiontree.php строка 216

◆ whereExists()

whereExists ( $query)

Exists() condition. Can be used with Query object or plain sql wrapped with SqlExpression.

Аргументы
Query | SqlExpression$query
Возвращает
$this

См. определение в файле conditiontree.php строка 377

◆ whereExpr()

whereExpr ( $expr,
$arguments )

Any SQL Expression condition

См. также
ExpressionField
Аргументы
string$expr
string[]$arguments
Возвращает
$this
Исключения
ArgumentException
SystemException

См. определение в файле conditiontree.php строка 450

◆ whereIn()

whereIn ( $column,
$values )

IN() condition.

Аргументы
string$column
array | Query | SqlExpression$values
Возвращает
$this

См. определение в файле conditiontree.php строка 277

◆ whereLike()

whereLike ( $column,
$value )

LIKE condition, without default % placement.

Аргументы
$column
$value
Возвращает
$this

См. определение в файле conditiontree.php строка 346

◆ whereMatch()

whereMatch ( $column,
$value )

Fulltext search condition.

См. также
Helper::matchAgainstWildcard() for preparing $value for AGAINST.
Аргументы
$column
$value
Возвращает
$this

См. определение в файле conditiontree.php строка 415

◆ whereNot()

whereNot ( ...)

Sets NOT before any conditions or subfilter.

См. также
ConditionTree::where()
Аргументы
mixed...$filter
Возвращает
$this

См. определение в файле conditiontree.php строка 198

◆ whereNotBetween()

whereNotBetween ( $column,
$valueMin,
$valueMax )

Negative BETWEEN condition.

См. также
ConditionTree::whereBetween()
Аргументы
$column
$valueMin
$valueMax
Возвращает
$this

См. определение в файле conditiontree.php строка 330

◆ whereNotExists()

whereNotExists ( $query)

Negative Exists() condition. Can be used with Query object or plain sql wrapped with SqlExpression.

См. также
ConditionTree::whereExists()
Аргументы
Query | SqlExpression$query
Возвращает
$this
Исключения
ArgumentException

См. определение в файле conditiontree.php строка 393

◆ whereNotIn()

whereNotIn ( $column,
$values )

Negative IN() condition.

См. также
ConditionTree::whereIn()
Аргументы
string$column
array | Query | SqlExpression$values
Возвращает
$this

См. определение в файле conditiontree.php строка 296

◆ whereNotLike()

whereNotLike ( $column,
$value )

Negative LIKE condition, without default % placement.

См. также
ConditionTree::whereLike()
Аргументы
$column
$value
Возвращает
$this

См. определение в файле conditiontree.php строка 362

◆ whereNotMatch()

whereNotMatch ( $column,
$value )

Negative fulltext search condition.

См. также
Helper::matchAgainstWildcard() for preparing $value for AGAINST.
Аргументы
$column
$value
Возвращает
$this

См. определение в файле conditiontree.php строка 431

◆ whereNotNull()

whereNotNull ( $column)

Compares column with NOT NULL.

Аргументы
string$column
Возвращает
$this

См. определение в файле conditiontree.php строка 262

◆ whereNull()

whereNull ( $column)

Compares column with NULL.

Аргументы
string$column
Возвращает
$this

См. определение в файле conditiontree.php строка 248

Поля

◆ $chains

$chains
protected

См. определение в файле conditiontree.php строка 31

◆ $conditions

$conditions = array()
protected

См. определение в файле conditiontree.php строка 34

◆ $isNegative

$isNegative = false
protected

См. определение в файле conditiontree.php строка 53

◆ $logic

$logic
protected

См. определение в файле conditiontree.php строка 40

◆ $randomSequence

RandomSequence $randomSequence
staticprotected

См. определение в файле conditiontree.php строка 43

◆ LOGIC_AND

const LOGIC_AND = 'and'

См. определение в файле conditiontree.php строка 47

◆ LOGIC_OR

const LOGIC_OR = 'or'

См. определение в файле conditiontree.php строка 45


Объявления и описания членов класса находятся в файле: