private function prepareVisitEventsStatementWhereAndBindValues(Criteria $criteria) { if ($criteria->getAggregateRootTypes()) { throw new CriteriaNotSupportedException('DBAL implementation cannot support criteria based on aggregate root types.'); } $bindValues = array(); $bindValueTypes = array(); $criteriaTypes = array(); if ($criteria->getAggregateRootIds()) { $criteriaTypes[] = 'uuid IN (:uuids)'; if ($this->useBinary) { $bindValues['uuids'] = array(); foreach ($criteria->getAggregateRootIds() as $id) { $bindValues['uuids'][] = $this->convertIdentifierToStorageValue($id); } $bindValueTypes['uuids'] = Connection::PARAM_STR_ARRAY; } else { $bindValues['uuids'] = $criteria->getAggregateRootIds(); $bindValueTypes['uuids'] = Connection::PARAM_STR_ARRAY; } } if ($criteria->getEventTypes()) { $criteriaTypes[] = 'type IN (:types)'; $bindValues['types'] = $criteria->getEventTypes(); $bindValueTypes['types'] = Connection::PARAM_STR_ARRAY; } if (!$criteriaTypes) { return array('', array(), array()); } $where = 'WHERE ' . join(' AND ', $criteriaTypes); return array($where, $bindValues, $bindValueTypes); }