PHP Класс SqlParser\Components\OptionsArray

Наследование: extends SqlParser\Component
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$options array ArrayObj of selected options.

Открытые методы

Метод Описание
__construct ( array $options = [] ) Constructor.
build ( OptionsArray $component, array $options = [] ) : string
has ( string $key, boolean $getExpr = false ) : mixed Checks if it has the specified option and returns it value or true.
isEmpty ( ) : boolean Checks tf there are no options set.
merge ( array | OptionsArray $options ) : void Merges the specified options with these ones. Values with same ID will be replaced.
parse ( Parser $parser, TokensList $list, array $options = [] ) : OptionsArray
remove ( string $key ) : boolean Removes the option from the array.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $options = [] )
$options array The array of options. Options that have a value must be an array with at least two keys `name` and `expr` or `value`.

build() публичный статический Метод

public static build ( OptionsArray $component, array $options = [] ) : string
$component OptionsArray The component to be built.
$options array Parameters for building.
Результат string

has() публичный Метод

Checks if it has the specified option and returns it value or true.
public has ( string $key, boolean $getExpr = false ) : mixed
$key string The key to be checked.
$getExpr boolean Gets the expression instead of the value. The value is the processed form of the expression.
Результат mixed

isEmpty() публичный Метод

Checks tf there are no options set.
public isEmpty ( ) : boolean
Результат boolean

merge() публичный Метод

Merges the specified options with these ones. Values with same ID will be replaced.
public merge ( array | OptionsArray $options ) : void
$options array | OptionsArray The options to be merged.
Результат void

parse() публичный статический Метод

public static parse ( Parser $parser, TokensList $list, array $options = [] ) : OptionsArray
$parser SqlParser\Parser The parser that serves as context.
$list SqlParser\TokensList The list of tokens that are being parsed.
$options array Parameters for parsing.
Результат OptionsArray

remove() публичный Метод

Removes the option from the array.
public remove ( string $key ) : boolean
$key string The key to be removed.
Результат boolean Whether the key was found and deleted or not.

Описание свойств

$options публичное свойство

ArrayObj of selected options.
public array $options
Результат array