class OptionsHandler extends AbstractOptions implements IOptions (View source)

Properties

static protected array $options

Array to store connection options

from  AbstractOptions
static protected IConnection $instance

Database connection instance

from  AbstractOptions

Methods

__construct(IConnection $instance)

Initialize options with a connection instance

getInstance()

Get the database connection instance

void
set(string $name, mixed $value)

Set an option value using dynamic method call

mixed
get(string $name)

Get an option value using dynamic method call

mixed
getOptions(int|null $type = null)

Get all options or a specific option type defined by user

void
setOptions(array|null $options = null)

This method is responsible for set options before connect in database

void
define()

This method is responsible for set options after connect in database

Details

__construct(IConnection $instance)

Initialize options with a connection instance

Parameters

IConnection $instance

The database connection instance

IConnection getInstance()

Get the database connection instance

Return Value

IConnection

The current database connection instance

void set(string $name, mixed $value)

Set an option value using dynamic method call

Parameters

string $name

The name of the option to set

mixed $value

The value to set

Return Value

void

mixed get(string $name)

Get an option value using dynamic method call

Parameters

string $name

The name of the option to get

Return Value

mixed

The value of the requested option

mixed getOptions(int|null $type = null)

Get all options or a specific option type defined by user

Parameters

int|null $type

Optional type of options to retrieve

Return Value

mixed

All options or specific type options if type parameter provided

void setOptions(array|null $options = null)

This method is responsible for set options before connect in database

Parameters

array|null $options

= null

Return Value

void

Exceptions

ReflectionException

void define()

This method is responsible for set options after connect in database

Return Value

void