Category : doctrine-orm

I am still new to Symfony and can’t figure out this error. Basically I try to remove the byUser from my database on the table wish. When the flush() function is executed I get the error # unable to fetch the response from the backend: unexpected EOF My controller: private $entityManager; public function __construct(EntityManagerInterface $entityManager) ..

Read more

I have a simple subscriber like the following: namespace App; use DoctrineCommonEventSubscriber; use DoctrineORMEventOnFlushEventArgs; use DoctrineORMEvents; class TestSubscriber implements EventSubscriber { public function getSubscribedEvents(): array { return [ Events::onFlush, ]; } public function onFlush(OnFlushEventArgs $eventArgs): void { // Some stuff } } When I add the Doctrine subscriber tag in a compilation pass, the onFlush ..

Read more

I’ve been stumped over this issue for 2days. I have a PHP doctrine code as follows $qb->andWhere( $qb->expr()->andX( $qb->expr()->orX( $qb->expr()->eq(‘wr.isApproved’, ‘:approved’), //The code below break (500 internal server error occures) $qb->expr()->isNull(‘wr.isApproved’) ), $qb->expr()->orX( $qb->expr()->eq(‘wr.isVerified’, ‘:verified’), $qb->expr()->isNull(‘wr.isVerified’) ), $qb->expr()->isNull(‘wr.isPaid’) ) ); $params[‘verified’] = true; $params[‘approved’] = false; Note, $qb is an instance of a repository class ..

Read more

I’m working on a legacy application built with Symfony-2. I’m trying to upgrade the used dependencies. I managed to upgrade Symfony to "symfony/symfony": "3.4.*". When I tried to upgrade: "doctrine/mongodb-odm": "1.*", "doctrine/mongodb-odm-bundle": "3.*", To: "doctrine/mongodb-odm": "2.*", "doctrine/mongodb-odm-bundle": "4.*", I encountered the following error: The service "doctrine.odm.mongodb.soft_delete.manager" has a dependency on a non-existent service "doctrine.odm.mongodb.document_manager". Obviously, ..

Read more

Category entity: public function __construct() { $this->candidates = new ArrayCollection(); } public function getCandidates() { return $this->candidates; } $metadata->mapManyToOne(array( ‘fieldName’ => ‘candidates’, ‘targetEntity’ => ‘EntitiesCandidate’, ‘inversedBy’ => ‘category’, ‘joinColumns’ => array( 0 => array( ‘name’ => ‘id’, ‘referencedColumnName’ => ‘category_id’, ‘nullable’ => true, ‘columnDefinition’ => NULL, ), ) )); Candidate entity: public function getCategory() { ..

Read more