Gravity_Forms\Gravity_Forms\GF_Service_Container
Class GF_Service_Container
A simple Service Container used to collect and organize Services used by the application and its modules.
Since: 2.5
Source: includes/class-gf-service-container.php:14
Details
- Kind:
class - Namespace:
Gravity_Forms\Gravity_Forms
Methods
| Method | Description |
|---|---|
add() | Add a service to the container. |
remove() | Remove a service from the container. |
get() | Get a service from the container by name. |
add_provider() | Add a service provider to the container and register each of its services. |
Method Reference
add()
public function add( $name, $service, $defer=false )
Add a service to the container.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name | string | The service Name | |
$service | mixed | The service to add | |
$defer | false |
Since: 2.5
Source: includes/class-gf-service-container.php:27
remove()
public function remove( $name )
Remove a service from the container.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name | string | The service name. |
Since: 2.5
Source: includes/class-gf-service-container.php:46
get()
public function get( $name )
Get a service from the container by name.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name | string | The service name. |
Returns
mixed|null
Since: 2.5
Source: includes/class-gf-service-container.php:59
add_provider()
public function add_provider( GF_Service_Provider $provider )
Add a service provider to the container and register each of its services.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$provider | GF_Service_Provider |
Since: 2.5
Source: includes/class-gf-service-container.php:79