is it possible to have association mapping with conditions in Doctrine 2.4? I have entities Article and Comment. Comments needs to be approved by admin. Approval status of c
You can use the Criteria API to filter the collection:
where(Criteria::expr()->eq('approved', true)); } return $this->comments->matching($criteria); } }
This is especially nice, because Doctrine is smart enough to only go to the database if the collection hasn't already been loaded.