Skip to content

Tag: doctrine-orm

Exception ‘no active transaction’ when using ORMExecutor::execute

I upgraded a legacy project from: PHP 5.6 -> 8.0 doctrine/orm 2.5.14 -> 2.13.4 doctrine/data-fixtures 1.2.2 -> 1.5.3 Now the following code throws the exception: PDOException : There is no active transaction /var/www/html/src/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:120 /var/www/html/src/vendor/doctrine/dbal/src/Connection.php:1481 /var/www/html/src/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:280 The exception is thrown when DoctrineORMEntityManager::transactional calls: $this->conn->commit() In the documentation I read: Not all RDBMS have the capability to allow TRUNCATE statements inside transactions

Symfony 6 – How to access properties of object of specific ID

I have two entities – one is Product, second – Order. I’ve created controllers to navigate between page of ProductController that lists the whole ProductRepository to the page of OrderController, which should: take a Product ID to show its properties on the Order page (name and price) have a form with quantity and “customer’s” email to be added to the

Doctrine ORM: Ignore all events with persist and flush

I’m working on a system which uses doctrine/orm 2.6 (PHP 7.1 & MySQL 5.7) and am trying to update a large number of entities using the following code: The issue I’m running into is that the entities have lots of lifecycle events registered (preUpdate, prePersist, postUpdate, postPersist), and some of these events involve expensive operations which aren’t necessary when doing

Error: Expected Literal, got ‘*’ in Doctrine

I want to retrieve the number of rows in my courrier table. In my fixtures, I have these lines : I have these mistakes when I do symfony console doctrine:fixtures:load : What’s wrong with the * in my query ? Answer Doctrine expects you to use one of the fields of your entity. In SQL you don’t need to use

Unable to create new answer in Symfony

I’m making a a app in Symfony. I get Entities Answer and Question which are related. I want to enable users to add the answer to the question but I’ve got the problem with getting question_id to AnswerEntity. Here it what I came up with: Answer Controller AnswerForm: and AnswerEntity The error is: [enter image description here][1] [1]: but