FileAccess Orion

ServiceLocatorInterface extends ContainerInterface, ContainerInterface

Interface for service locator

Table of Contents

build()  : mixed
Build a service by its name, using optional options (such services are NEVER cached).
get()  : mixed
Finds an entry of the container by its identifier and returns it.
has()  : bool
Returns true if the container can return an entry for the given identifier.

Methods

build()

Build a service by its name, using optional options (such services are NEVER cached).

public build(string $name[, null|array<string|int, mixed> $options = null ]) : mixed
Parameters
$name : string
$options : null|array<string|int, mixed> = null
Tags
throws
ServiceNotFoundException

If no factory/abstract factory could be found to create the instance.

throws
ServiceNotCreatedException

If factory/delegator fails to create the instance.

throws
ContainerExceptionInterface

if any other error occurs

Return values
mixed

has()

Returns true if the container can return an entry for the given identifier.

public has(string $id) : bool

Returns false otherwise.

has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.

Parameters
$id : string

Identifier of the entry to look for.

Return values
bool

Search results