\Omega\Support\Facade AbstractFacade

Facade class.

The Facade class serves as a base for creating facades in the Omega framework. It provides a static interface to underlying classes, allowing developers to access functionalities without directly instantiating those classes. This pattern promotes cleaner code and adheres to the principles of dependency injection and inversion of control.

Each facade must implement the getFacadeAccessor method to specify the service it represents in the application.

Summary

Methods
Properties
Constants
__callStatic
getFacadeAccessor
No public properties found
No public constants found
resolveFacadeInstance
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Methods

__callStatic()

__callStatic(string  $method, array  $arguments) : mixed

Handle dynamic static calls to the facade.

This magic method intercepts static method calls on the facade and delegates the call to the underlying instance retrieved from the application container. If the instance is not set, it throws a RuntimeException.

Parameters

string $method

Holds the name of the method being called.

array $arguments

Holds the arguments passed to the method.

Throws

\Omega\Support\Facade\Exception\FacadeObjectNotSetException

If a facade root has not been set.

Returns

mixed —

Return the result of the method call on the underlying instance.

getFacadeAccessor()

getFacadeAccessor() : string

Get the facade accessor.

This method must be implemented by subclasses to return the key used to resolve the underlying instance from the application container.

Returns

string —

Return the key used to access the underlying instance.

resolveFacadeInstance()

resolveFacadeInstance() : mixed

Resolve the facade instance.

This method retrieves the underlying instance for the facade from the application container. It calls the resolve method on the application instance, using the value returned by getFacadeAccessor.

Returns

mixed —

Return the resolved instance of the underlying class.