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 …

How can I get access to related entities with Symfony doctrine?

I try to find all documents that are related to my product: public function findDocumentsRelatedToProduct($id) { return $this->createQueryBuilder(‘products’) ->…

Doctrine get Product with most sales

I have a Product Entity with many Orders as association. I want to build a repository method that brings the most sold products. Each order only have 1 product with 1 quantity so, quantity is …

Symfony : How to fetch all object data from entity related with oneToMany relationship

I have “Car” and “Booking” entities related with oneToMany relationship :

Doctrine query builder – where IN with non string column names can’t be generated

I can’t sleep because of this, I either must be missing something really obvious or it can’t be done like that. I have this Doctrine Query Builder thingy: $this->queryBuilder ->…

Deserialize a entities array with Symfony Serializer Component and AbstractNormalizer::OBJECT_TO_POPULATE

I already deserialize into a array of object with : $encoders = [new JsonEncoder()]; $normalizers = [new ObjectNormalizer(), new GetSetMethodNormalizer(), new ArrayDenormalizer()]; $serializer = new …

How i persist data with @ManyToMany Symfony4

I have problem when I want import data (csv) officer with relation ManyToMany Department : the officer (agent in french) are store but the relation are not created (table agent_departement). Agent …

WebfactoryPolyglotBundle use causes error “No mapping found for field ‘id’ on class ‘AppBundleEntityFilm’.”

I use the Symfony version 3.4.0 and I try to use this bundle to translate entities : https://github.com/webfactory/WebfactoryPolyglotBundle So I created two entities ( Film and FilmTranslation ) for …

Attempted to call an undefined method named “getEntityManager” of class

I’m learning symfony and I would like to have a search bar to show user with email. But I got and error Attempted to call an undefined method named “getEntityManager” of class “AppRepository…

File not found exception on Symfony upload

I’m using Symfony 3.4 to work on a simple REST API microservice. There are not much resources to be found when working with HTTP APIs and file uploads. I’m following some of the instructions from the …