Приветствую.
Пужна помощь
У меня есть бандл , сделанный из сваггера
Есть интерфейсы
Мне надо как-то прокинуть entityManager и работать с ним
Классическим способом, как прокидывала в консольных командах,
типа
public function __construct(EntityManagerInterface $entityManager)
{
$this->entityManager = $entityManager;
}
не получилось
Ошибка такая
"Service \"kernel\" not found: even though it exists in the app's container, the container inside \"Aliexpress\\Server\\Controller\\StoreController\" is a smaller service locator that only knows about the \"doctrine\", \"http_kernel\", \"parameter_bag\", \"request_stack\", \"router\", \"security.authorization_checker\", \"security.csrf.token_manager\", \"security.token_storage\", \"session\" and \"twig\" services. Try using dependency injection instead."
Решение понятно
Try using dependency injection instead
Ок, пробую добавить через calls и setEntityManager и получаю новое
constructor of class "Doctrine\ORM\EntityManager" must be public
Добавила
entityManager:
public: true
class: Doctrine\ORM\EntityManager
только он ругается "конструктор EntityManager must be true"