PHP Class SqlParser\Components\OptionsArray

Inheritance: extends SqlParser\Component
Afficher le fichier Open project: phpmyadmin/sql-parser Class Usage Examples

Méthodes publiques

Свойство Type Description
$options array ArrayObj of selected options.

Méthodes publiques

Méthode 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 méthode

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 méthode

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

has() public méthode

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.
Résultat mixed

isEmpty() public méthode

Checks tf there are no options set.
public isEmpty ( ) : boolean
Résultat boolean

merge() public méthode

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.
Résultat void

parse() public static méthode

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.
Résultat OptionsArray

remove() public méthode

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

Property Details

$options public_oe property

ArrayObj of selected options.
public array $options
Résultat array