My real problem is that I am sending an Ajax Jquery Request to an API of mine, the server response is ‘Argument #1 of ::setDate() must be DateTimeInterface, string given’ I tried to cast but it was useless. My Ajax at JQUERY: My API at PHP (Symfony’s controller): The Object I’m sending: Answer Your entity Distribucion probably has a setter
Tag: doctrine
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
Doctrine “Entity” is not a valid entity or mapped super class
In my doctrine.php I have the following configuration And my Entity class is defined as follows I tried accessing it like by calling getRepository like this But this fails with the is not a valid entity or mapped super class P.S. If necessary, this is my EntityRepository.php Answer I found an issue. I am a dummy.. I had to change
Symfony – Undefined type ‘DoctrineORMMappingEntity
I got many errors similar to this in topic after created entities. Dont’t know why cuz use tag seems correct. Using symfony 6.1. Here is my model: Answer Instead of this try that
postUpdate, postRemove, postPersist – is the data in the database yet?
For the purposes of the question I’ll ask about postUpdate but I’m assuming they’re all analogous. If I fetch an existing entity, modify it, and then flush, then I can subscribe to a postUpdate event about this. At the point that this event fires, is the data actually in the database yet? Or there a tiny amount of time in
How to get data from a column with this annotation @ORMindex
Good afternoon, please tell me how to get the column data: {@ORMIndex(name=”localities_names_idx”, columns={“name_ru”, “name_cn”, “name_en”}) I tried using queryBuilder : Without success I need it for: Answer Edit: This turned into a review, but might as well keep it here You’re using index wrong. I’m guessing you’re using it incorrectly. I’m assuming you want an index for faster search. However,
An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘pokemon_id’ cannot be null
I’m a bit clueless. I would like to import data to my DB. This is a example entity: all fields nesassary fields were filled, but doctrine tells me: Here is the snipped of my entity. Where did i miss the point? P.S.: Maybe I should also tell that this property never can be null. And I have a relation to
How to get column properties in Doctrine custom type convertToDatabaseValue function?
As the title suggests, I am making my own Type in Doctrine and the type has its precision and scale options in getSQLDeclaration() function. I need somehow to access these from convertToDatabaseValue() as well, as I need to round the number with given precision. So the Entity column then looks like: And I need to get the scale or precision
Symfony 5.4 Form: Issue with EntityType custom query_builder orderBy(‘rand’) and setMaxResult
I’m struggling with a ‘strange’ behavior. When I use setMaxResult() + Rand() on my query_builder. I got randomly the message that my value is not valid. SymfonyComponentValidatorConstraintViolation {#1320 ▼ -message: “Cette valeur n’est pas valide.” -messageTemplate: “This value is not valid.” -parameters: [▶] -plural: null -root: SymfonyComponentFormForm {#911 ▶} -propertyPath: “children[press]” -invalidValue: “8” -constraint: SymfonyComponentFormExtensionValidatorConstraintsForm {#987 …} -code: “1dafa156-89e1-4736-b832-419c2e501fca” -cause:
Symfony 6 data access and transmission between multiple tables with format error [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 10 months ago. Improve this question