Skip to content
Advertisement

Tag: doctrine-orm

Symfony 5 – ManyToOne __isInitialized__: false

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

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,

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.

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

Advertisement