Category: doctrine-odm

Best approach for getting one specific record from an ArrayCollection

I have a “Customer” entity which has a OneToMany relation with “Phones”. Phones has a “IsMain” field to identify which record is the main phone and a “category” field for the type (i.e. mobile, landline, fax). I’m attempting to use…

How to add multiple "AND" conditions in a JOIN

I’m trying to add a “AND” condition to the join query but haven’t been able to figure it out (not sure if it’s even possible via Doctrine/Symfony). I’d appreciate any help with this. ->select(‘c, p’) ->from(Customer::class, ‘c’) ->leftJoin(‘c.phones’, ‘p’) Example:-…

Attempted to call an undefined method named "allowDiskUse" of class "DoctrineODMMongoDBAggregationBuilder

I am trying to get last purchases with item, location and batch. So I tried to get ids of each by grouping. I can’t use group command because it is huge data and can not be handle by group command….