Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Класс 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 строка 27

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

◆ __construct()

__construct ( )

ConditionTree constructor.

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

Методы

◆ __clone()

__clone ( )

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

◆ addCondition()

addCondition ( $condition)

Adds prepared condition.

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

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

◆ 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 строка 703

◆ createFromArray()

static createFromArray ( $filter)
static

Creates filter object from array

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

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

◆ getConditions()

getConditions ( )

Returns all conditions and subfilters.

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

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

◆ getRandomSequence()

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

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

◆ hasConditions()

hasConditions ( )

Checks if filter is not empty.

Возвращает
bool

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

◆ 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 строка 70

◆ negative()

negative ( $negative = true)

Sets NOT before all the conditions.

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

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

◆ removeAllConditions()

removeAllConditions ( )

Removes all conditions

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

◆ removeCondition()

removeCondition ( $condition)

Removes one condition

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

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

◆ replaceCondition()

replaceCondition ( $currentCondition,
$newCondition )

Replaces condition with a new one.

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

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

◆ where()

where ( $filter)

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 строка 125

◆ whereBetween()

whereBetween ( $column,
$valueMin,
$valueMax )

BETWEEN condition.

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

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

◆ whereColumn()

whereColumn ( $filter)

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

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

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

◆ whereExists()

whereExists ( $query)

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

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

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

◆ whereExpr()

whereExpr ( $expr,
$arguments )

Any SQL Expression condition

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

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

◆ whereIn()

whereIn ( $column,
$values )

IN() condition.

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

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

◆ whereLike()

whereLike ( $column,
$value )

LIKE condition, without default % placement.

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

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

◆ whereMatch()

whereMatch ( $column,
$value )

Fulltext search condition.

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

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

◆ whereNot()

whereNot ( $filter)

Sets NOT before any conditions or subfilter.

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

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

◆ whereNotBetween()

whereNotBetween ( $column,
$valueMin,
$valueMax )

Negative BETWEEN condition.

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

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

◆ 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 строка 392

◆ whereNotIn()

whereNotIn ( $column,
$values )

Negative IN() condition.

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

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

◆ whereNotLike()

whereNotLike ( $column,
$value )

Negative LIKE condition, without default % placement.

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

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

◆ whereNotMatch()

whereNotMatch ( $column,
$value )

Negative fulltext search condition.

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

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

◆ whereNotNull()

whereNotNull ( $column)

Compares column with NOT NULL.

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

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

◆ whereNull()

whereNull ( $column)

Compares column with NULL.

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

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

Данные класса

◆ $chains

$chains
protected

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

◆ $conditions

$conditions = array()
protected

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

◆ $isNegative

$isNegative = false
protected

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

◆ $logic

$logic
protected

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

◆ $randomSequence

RandomSequence $randomSequence
staticprotected

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

◆ LOGIC_AND

const LOGIC_AND = 'and'

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

◆ LOGIC_OR

const LOGIC_OR = 'or'

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