W
W
wolfcruel972018-11-02 15:10:22
symfony
wolfcruel97, 2018-11-02 15:10:22

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

1 answer(s)
G
GTRxShock, 2018-11-02
@GTRxShock

use Symfony\Bridge\Doctrine\RegistryInterface;
// ...
protected $doctrine;
// ...
public function __construct(RegistryInterface $registry)
{
    // доктрина ($registry) в констуктор заинжектится сама
    $thits->doctrine = $registry;
}

ps but in general it would be great to clarify what is still required, since the dock is full of examples

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question