[FrameworkBundle] Adding a check for the existence of the Doctrine service
This commit is contained in:
parent
1ac4675e32
commit
172c956b73
@ -144,6 +144,10 @@ class Controller extends ContainerAware
|
||||
*/
|
||||
public function getDoctrine()
|
||||
{
|
||||
if (!$this->has('doctrine')) {
|
||||
throw new \LogicException('The DoctrineBundle is not installed in your application.');
|
||||
}
|
||||
|
||||
return $this->get('doctrine');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user