class Statement (View source)

The GenericDatabase\Generic\Statements\Statement class is a class that represents a statement.

Method:

  • bind(array $params): object: This method binds parameters to a statement

Traits

This trait provides magic methods for dynamic property access and manipulation, including getter, setter, isset, and unset operations. Supports serialization and deserialization through __sleep and __wakeup methods. Converts object properties to an associative array with the toArray method.

Properties

mixed|null $statement
mixed|null $query
mixed|null $by
mixed|null $is

Methods

mixed
__get(string $name)

Magic getter method

void
__set(string $name, mixed $value)

Magic setter method to dynamically set properties.

bool
__isset(string $name)

This method is triggered by calling isset() or empty() on inaccessible (protected or private) or non-existing properties.

void
__unset(string $name)

This method is invoked when unset() is used on inaccessible (protected or private) or non-existing properties.

array
__sleep()

Sleep instance used by serialize/unserialize

void
__wakeup()

Wakeup instance used by serialize/unserialize

array
toArray()

Returns the object properties as an associative array

static Statement
bind(array $params)

This method binds parameters to a statement

Details

mixed __get(string $name)

Magic getter method

Parameters

string $name

Name of the property to access

Return Value

mixed

The value of the property, or null if it does not exist

void __set(string $name, mixed $value)

Magic setter method to dynamically set properties.

If the property is an array and already exists as an instance of the current class, it will recursively set each key-value pair on the existing instance. Otherwise, it assigns the value directly to the property.

Parameters

string $name

Name of the property to set

mixed $value

Value to assign to the property

Return Value

void

bool __isset(string $name)

This method is triggered by calling isset() or empty() on inaccessible (protected or private) or non-existing properties.

Parameters

string $name

Argument to be tested

Return Value

bool

void __unset(string $name)

This method is invoked when unset() is used on inaccessible (protected or private) or non-existing properties.

Parameters

string $name

Argument to be tested

Return Value

void

array __sleep()

Sleep instance used by serialize/unserialize

Return Value

array

void __wakeup()

Wakeup instance used by serialize/unserialize

Return Value

void

array toArray()

Returns the object properties as an associative array

Return Value

array

static Statement bind(array $params)

This method binds parameters to a statement

Parameters

array $params

Arguments list

Return Value

Statement