|
| get (string $id) |
| Finds an entry of the container by its identifier and returns it.
|
|
| has (string $id) |
| Returns true if the container can return an entry for the given identifier.
|
|
◆ get()
Psr\Container\ContainerInterface::get |
( |
string | $id | ) |
|
Finds an entry of the container by its identifier and returns it.
- Parameters
-
string | $id | Identifier of the entry to look for. |
- Exceptions
-
NotFoundExceptionInterface | No entry was found for this identifier. |
ContainerExceptionInterface | Error while retrieving the entry. |
- Return values
-
Implemented in DI\CompiledContainer, and DI\Container.
◆ has()
Psr\Container\ContainerInterface::has |
( |
string | $id | ) |
|
Returns true if the container can return an entry for the given identifier.
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
-
string | $id | Identifier of the entry to look for. |
- Return values
-
Implemented in DI\CompiledContainer, and DI\Container.
The documentation for this interface was generated from the following file:
- lib/psr/container/src/ContainerInterface.php