Category: doctrine

Symfony Doctrine Exception [closed]

I’m trying to sync my project using this command: php app/console doctrine:migrations:migrate –em=domain –configuration=app/config/migrations/domain.yml –env=prod And the terminal is returning a Doctrine error. See more below: [DoctrineDBALExceptionConnectionException] An exception occurred in driver: SQLSTATE[HY000] [1044] Access denied for user ‘user_admin’@’localhost’ to…

How can I remove doctrine proxies field in symfony 5 json?

My code: public function findAll(): JsonResponse { $products = $this->productRepository->findAll(); return $this->json(( new ApiJsonResponse(ApiJsonResponse::TYPE_SUCCESS, $products) )); } return: “productType”: { “id”: 1, “name”: “product type 1”, “active”: true, “initializer”: null, “cloner”: null, “isInitialized”: true } I’m using sumfony 5 and…

Create nested doctine objects with one GraphQl query with API Platform

I have a basic Entity in my symfony application: /** * @ApiResource() * @ORMEntity(repositoryClass=CardRepository::class) */ class Card { /** * @ORMId() * @ORMGeneratedValue() * @ORMColumn(type=”integer”) */ private $id; /** * @ORMOneToMany(targetEntity=CardReference::class, mappedBy=”card”, orphanRemoval=true) */ private $cardReferences; /** * @ORMColumn(type=”string”, length=255,…

"Cannot declare class X because the name is already in use" after change in length in Symfony, Doctrine

Been scratching my head over this for hours. I’ve inherited a large PHP project and it’s now my responsibility. I also admit that I am not very experienced with Symfony. Looked all over StackOverFlow for help, but still cannot resolve…