Skip to content
Advertisement

Tag: doctrine

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 Answer The problem is Doctrine’s lazy loading of collections, which is

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 that the $page->removeSynonym($synonym); line

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 object. No matter how many objects are there in

Advertisement