[FrameworkBundle] Adding a check for the existence of the Doctrine service

This commit is contained in:
Ryan Weaver 2011-06-02 13:26:51 -05:00
parent 1ac4675e32
commit 172c956b73

View File

@ -144,6 +144,10 @@ class Controller extends ContainerAware
*/ */
public function getDoctrine() public function getDoctrine()
{ {
if (!$this->has('doctrine')) {
throw new \LogicException('The DoctrineBundle is not installed in your application.');
}
return $this->get('doctrine'); return $this->get('doctrine');
} }