I try to get value from object but objects return __isInitialized__: false and null values what did I miss? twig situ dump : situ entity : event entity : category entity : Answer You just got to know the doctrine lazy loading feature. It fetches the data until you fired the getter method the first time. You could know this
Tag: doctrine-orm
Doctrine insists on trying to use PostgreSQLDriver despite contrary config
I am setting up a Symfony 5.2 app, using doctrine/doctrine-bundle 2.4 and doctrine/orm 2.9. My doctrine.yaml config file looks like this: The problem is that when I run doctrine:fixtures:load, I get the following output: It looks like Doctrine is trying to use the Postgre driver, though I have specified MySQL. Is there another place where I need to configure this?
Symfony 5 / Doctrine: Sorting entity collection by creation DateTime
I am developing a project using Symfony 5. One of my use-cases involves reading a collection from the Database, with the items sorted by creation order, descending (newest first). I am using the “Timestampable” extension from “stof/doctrine-extensions-bundle” to save the createdAt and updatedAt timestamps in my entity. According to Doctrine documentation, I can sort items ussing the Repository methods: This
“Error [Semantical Error] The annotation “@DoctrineORMMappingOnetoMany” in property” on Gitlab CI but not in local env or production [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 last year. Improve this question I’ve
Doctrine – relation of three tables
I have trouble with writing Doctrine Query Builder. I have a Posts table which is related to the AccountToken table like: I am writing a query builder where I want to pull all the results which are related to that table via UUID and have a specific status. The type value is defined in the AccountToken table. In that table,
Doctrine 2 – MySql : multiples ‘BASE TABLE’ queries added to every views
Do you know why every views of my Symfony 4.4.25 website using Doctrine ORM 2.9.3 add between 3 and 10 queries like this: The database is MySQL version 5.7 Answer I had the same issue from a recent symfony 4.4 install, and fix it by removing the following parameter from doctrine_migrations.yaml:
Only annotation mapping is supported by Maker Bundle
I have changed the configuration of my Symfony project to use PHP attributes with Doctrine in my Entities. I was really happy about this and wanted to give it a try. I have changed my doctrine.yaml from annotation to attribute and use attributes in my entities With this configuration my php bin/console do:sc:up -f works well. But when I try
Working with Doctrine array of enum and store it in a separate table
I’m currently building Entity model and one of my Doctrine Entities have ManyToMany relation with an external dictionary (like ENUM). So the entity field will be an Array of Enum. I’m looking for a way to have it as an array field on my entity, but to store it as a separate DB table. Would like to get any advice/links/etc.
Top level EXISTS query using Doctrine ORM
I have a query such as this in plain SQL (of course the original is more complex, but still simple enough that I’m quite sure that that part is correct at least): SELECT EXISTS (SELECT 1 FROM mytable …
Doctrine unexpected behavior on bidirectional relations
I define two entities with bidirectional relations: One And two If I drop all related Product entities, the related productSet entity automatically dropped too. And I don’t understand why. How I prevent this behavior? Doctrine version 2.6.3 Answer according to docs – https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/working-with-associations.html#transitive-persistence-cascade-operations and you have cascade: [‘all’] – the behavior is as expected