Hellow, in de Doctrine documentations says: ‘Doctrine will only check the owning side of an association for changes.’ I have read other posts here, but I can’t find an example that makes me …
Tag: doctrine
Fetching objects from database in Symfony
I have entity Domain which has fields id, domain, users in field users, I have an id which is the id of the user who created that domain. now I have created for in the template which will display …
Doctrine QueryBuilder – CASE WHEN
I have a question about case when in doctrine. The problem with this is when uim.isProfileImage is 1 for a user, that returns that row and every other row in user_image table for that user. What I …
Symfony OneToMany Assiociations not working
I have Product entity and ProductAttachment entity. One product should be able to have many attachments. I Used Doctrine mapping OneToMnay – ManyToOne but everytime i get product, it has empty $files collection ProductAttachment Entity Product Entity Am i Missing anything? When i call this is what i get…
Could not find any fixture services to load
i know this question has been asked already multiple times: Symfony 3.4 and Fixtures Bundle issue with bundle version 3.0 Symfony 3.4.0 Could not find any fixture services to load Symfony Doctrine …
Warning: Illegal offset type in isset or empty
I have two Doctrine entities: Page and Synonym. Each Page contains references to several Synonyms, and I want to make sure that no Synonym names are duplicated. So I create a symfony command that runs through the synonyms on a page, checking for duplicates: So far, so good. But when I run my command, I find t…
Return data from Doctrine inside a JsonResponse object
My problem is that I want to return some data that I get from Doctrine inside a JsonResponse object. I get the data with a QueryBuilder, like this: However, the data inside the JsonResponse looks empty: Does anyone know how I can return the data this way correctly? Answer I think you’re getting the arra…
Symfony 4 make:entity {entity} generate in a custom directory in a multi doctrine connection
New to symfony here I have a two connection setup in my config/packages/doctrine.yaml. Is it possible to generate an Entity class using the cli tool php bin/console make:entity Product to generate entity in a custom directory. When I run the above command the “Product” enttity class gets generated…
Programmatically load Entity in symfony
I am trying to load in Entity classes and use within a loop in order to load content in dynamically from files into relating tables. Is there any way i can load in all Entity files from the following …
symfony @oneToMany relation returns only last object in collection
I have a situation and not really sure what I’m doing wrong. in Sumfony 3.3 I’ve created a relation between entity Page and Language, where Page is related to multiple Languages, and when I search for a Page and get Page object but property Languages returns collection with only last Language obje…