Container
class Container implements ContainerInterface, ArrayAccess
Class Container
Methods
Get an entry from the container.
See if the container has an entry for the ID.
Add a new entry to the container.
Check to see if an offset exists.
Get an Offset.
Set an Offset.
Unset an Offset.
Details
at line 31
mixed
get(string $id)
Get an entry from the container.
This method will attempt to get an entry from the container. The ID must be a string or it will throw a ContainerException. It will then check if the container has an entry for that ID, if it does not then it will throw a NotFoundException.
at line 58
bool
has(string $id)
See if the container has an entry for the ID.
Has will check the container to see if there is an entry for the ID. The ID must be a string or it will throw a ContainerException. Then it will check to see if the container has an entry, it will return true if it has one and false if it doesn't.
at line 82
mixed
set($id, $value)
Add a new entry to the container.
Set will add a new entry to the container. The ID must be a string or it will throw a ContainerException. The value can be anything, as long as it isn't itself. Don't try and add the container to the container. It returns the value that you set, if you want to confirm that.
at line 96
offsetExists(string $offset)
Check to see if an offset exists.
Essentially returns isset on a key in the private property $container
.
at line 108
offsetGet(mixed $offset)
Get an Offset.
Essentially the same as accessing an offset of an array.
at line 121
offsetSet(string $offset, mixed $value)
Set an Offset.
Essentially the same as setting a key/value of an array.
at line 133
offsetUnset(string $offset)
Unset an Offset.
Essentially unsetting a key/value of an array.