Commit 618b1691 authored by Jon Pugh's avatar Jon Pugh

Add a getService() method to Context.

parent 53ac89fc
......@@ -226,6 +226,20 @@ class Context
return $this->services;
}
/**
* Return all services for this context.
*
* @return array
*/
public function getService($type) {
if (isset($this->services[$type])) {
return $this->services[$type];
}
else {
throw new \Exception("Service '$type' does not exist.");
}
}
/**
* {@inheritdoc}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment