Skip to content

Tag: symfony

Get data from multiple rows

I would like to get the value of the column uid from all rows where the value of the column city is london. I have tried it like this: $this->getDoctrine()->getRepository(Personal::class)->…

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…

How to inject global variables into all templates?

In my twig template there are some variables that are required on each page like userName, userId or userImage. What is the best way to inject them into the template? I already read the article How to Inject Variables into all Templates but how could I write a variable (e.g. current user) into the config/pack…