AbstractAttributes
abstract class AbstractAttributes implements IAttributesAbstract (View source)
The GenericDatabase\Abstract\AbstractAttributes class implements the IAttributesAbstract interface and serves as a base class for
defining attributes in the PHP-Generic-Database project. It provides a common interface and shared functionality for all attribute classes.
This class provides a structure for managing dynamic properties using a connection instance and options handler. It allows setting and getting properties dynamically by utilizing the Run::call method to invoke methods on the connection instance.
Main functionalities:
- Manages the connection instance and options handler.
- Provides a base implementation for defining attributes in the PHP-Generic-Database project.
- Allows dynamic setting and getting of attribute values.
- Provides a common interface for all attribute classes.
Methods:
getInstance(): IConnection:Returns the static instance of IConnection.getOptionsHandler(): IOptions:Returns the static instance of IOptions.set(string $name, mixed $value): void:Sets a property dynamically on the connection instance.get(string $name): mixed:Retrieves a property dynamically from the connection instance.
Fields:
$instance: The connection instance used for dynamic operations.$optionsHandler: The options handler for managing configuration.
Properties
| static protected IConnection | $instance | ||
| static protected IOptions | $optionsHandler |
Methods
Get the connection instance.
Get the options handler instance.
Set an attribute value using dynamic method call.
Get an attribute value using dynamic method call.
Details
__construct(IConnection $instance, IOptions $optionsHandler)
Constructor for AbstractAttributes.
IConnection
getInstance()
Get the connection instance.
IOptions
getOptionsHandler()
Get the options handler instance.
void
set(string $name, mixed $value)
Set an attribute value using dynamic method call.
mixed
get(string $name)
Get an attribute value using dynamic method call.