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…
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/ve…
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 du…
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…
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 ke…
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 nee…
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: “…
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 …