Answer the question
In order to leave comments, you need to log in
How to access Doctrine in Service Containers?
How to access Doctrine in Service Containers?
Answer the question
In order to leave comments, you need to log in
use Symfony\Bridge\Doctrine\RegistryInterface;
// ...
protected $doctrine;
// ...
public function __construct(RegistryInterface $registry)
{
// доктрина ($registry) в констуктор заинжектится сама
$thits->doctrine = $registry;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question