\QueryPathOptions

Manage default options.

This class stores the default options for QueryPath. When a new QueryPath object is constructed, options specified here will be used.

Details This class defines no options of its own. Instead, it provides a central tool for developers to override options set by QueryPath. When a QueryPath object is created, it will evaluate options in the following order:

  • Options passed into qp() have highest priority.
  • Options in QueryPath::Options (this class) have the next highest priority.
  • If the option is not specified elsewhere, QueryPath will use its own defaults.

Summary

Methods
Properties
Constants
set()
get()
merge()
has()
$options
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$options

$options : 

This is the static options array.

Use the \set(), \get(), and \merge() to modify this array.

Type

Methods

set()

set(array  $array) 

Set the default options.

The passed-in array will be used as the default options list.

Parameters

array $array

An associative array of options.

get()

get() : array

Get the default options.

Get all options currently set as default.

Returns

array —

An array of options. Note that only explicitly set options are returned. {@link QueryPath} defines default options which are not stored in this object.

merge()

merge(array  $array) 

Merge the provided array with existing options.

On duplicate keys, the value in $array will overwrite the value stored in the options.

Parameters

array $array

Associative array of options to merge into the existing options.

has()

has(string  $key) 

Returns true of the specified key is already overridden in this object.

Parameters

string $key

The key to search for.