[Flow] Find all Objects with an empty Collection
David Sporer
david.sporer at gmail.com
Mon Jan 20 21:36:07 CET 2014
Hi,
I have a Model containing an 1:n relationship:/** * The pushNotificationRegistrations * @var \Doctrine\Common\Collections\Collection<\My\Project\Domain\Model\Registration> * @ORM\OneToMany(mappedBy="User") */ protected $registrations;
Is it possible to find all Objects where the count of the Collection is 0?I tried this in the Repository but it doesn't work:public function countEmpty(){ $query = $this->createQuery(); return $query->matching($query->equals('registrations.count', 0))->count(); }
But this doesn't seem to work.
Do you have an idea how to solve this?
RegardsDavid
More information about the Flow
mailing list