class ordered_service_collection extends service_collection

Collection of services in a specified order

Properties

protected ContainerInterface $container from  service_collection
protected array $service_classes from  service_collection
protected bool $is_ordered
protected array $service_ids

Methods

__construct(ContainerInterface $container)

Constructor

getIterator()

{@inheritdoc}

offsetGet($index)

{@inheritdoc}

void
add(string $service_id, int $order = 0)

Adds a service ID to the collection

add_service_class(string $service_id, string $class)

Add a service's class to the collection

array
get_service_classes()

Get services' classes

mixed
get_by_class($class)

Returns the service associated to a class

offsetExists($index)

{@inheritdoc}

sort_services()

No description

Details

at line 38
__construct(ContainerInterface $container)

Constructor

Parameters

ContainerInterface $container

Container object

at line 49
getIterator()

{@inheritdoc}

at line 75
offsetGet($index)

{@inheritdoc}

Parameters

$index

at line 91
void add(string $service_id, int $order = 0)

Adds a service ID to the collection

Parameters

string $service_id
int $order

Return Value

void

in service_collection at line 77
add_service_class(string $service_id, string $class)

Add a service's class to the collection

Parameters

string $service_id
string $class

in service_collection at line 87
array get_service_classes()

Get services' classes

Return Value

array

in service_collection at line 98
mixed get_by_class($class)

Returns the service associated to a class

Parameters

$class

Return Value

mixed

Exceptions

RuntimeException

if the service isn't found

at line 62
offsetExists($index)

{@inheritdoc}

Parameters

$index

at line 98
protected sort_services()

No description