Use Doctrine Collections expressions with Zend\Db\Sql for smart criteria / filtering / query building.