PHP Class SqlParser\Components\OptionsArray

Inheritance: extends SqlParser\Component
Show file Open project: phpmyadmin/sql-parser Class Usage Examples

Public Properties

Property Type Description
$options array ArrayObj of selected options.

Public Methods

Method Description
__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.

Method Details

__construct() public method

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 method

public static build ( OptionsArray $component, array $options = [] ) : string
$component OptionsArray The component to be built.
$options array Parameters for building.
return string

has() public method

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.
return mixed

isEmpty() public method

Checks tf there are no options set.
public isEmpty ( ) : boolean
return boolean

merge() public method

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.
return void

parse() public static method

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.
return OptionsArray

remove() public method

Removes the option from the array.
public remove ( string $key ) : boolean
$key string The key to be removed.
return boolean Whether the key was found and deleted or not.

Property Details

$options public property

ArrayObj of selected options.
public array $options
return array