Returns service ids for a given tag.
Example:
$container->register('foo')->addTag('my.tag', array('hello' => 'world'));
$serviceIds = $container->findTaggedServiceIds('my.tag'); foreach ($serviceIds as $serviceId => $tags) { foreach ($tags as $tag) { echo $tag['hello']; } }
@api
string $name The tag name:
array An array of tags with the tagged service as key, holding a list of attribute arrays.
Overrides TaggedContainerInterface::findTaggedServiceIds
public function findTaggedServiceIds($name) {
$tags = array();
foreach ($this
->getDefinitions() as $id => $definition) {
if ($definition
->hasTag($name)) {
$tags[$id] = $definition
->getTag($name);
}
}
return $tags;
}