Error: Call to a member function has() on a non-object ?
Bonjours tous,
j'ai une classe "ActImplementation" (n'est pas un controlleur) qui implément une interface "ActInterface". Alors, cette classe contient tous les traitements des fonctions de l'interface "ActInterface".
le probléme que "$this->getDoctrine()" n'est pas fonctionnel , il s'affiche ce message d'erreur:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Error: Call to a member function has() on a non-object
500 Internal Server Error - FatalErrorException
--
Stack Trace
in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php at line 291 -
*/
public function getDoctrine()
{
if (!$this->container->has('doctrine')) {
throw new \LogicException('The DoctrineBundle is not registered in your application.');
}
--
// mon code
/*at Controller ->getDoctrine () in src/CisBenchMarksBundle/Metier/ActImplementation.php at line 79 -*/
var_dump($this->getDoctrine()->getManager()); //ligne 79
exit();
return $r;
} |
comment faire fonctionner l'ORM ($this->getDoctrine()) dans ma classe?
Merci d'avance;