private function prepareVisitCommittedEventsStatementWhereAndBindValues(Criteria $criteria)
 {
     $bindValues = [];
     $bindValueTypes = [];
     $criteriaTypes = [];
     if ($criteria->getAggregateRootTypes()) {
         $criteriaTypes[] = 'aggregate_root_type IN (:aggregateRootTypes)';
         $aggregateRootTypeContractNames = array_map(function (Contract $aggregateRootType) {
             return $aggregateRootType->getContractName();
         }, $criteria->getAggregateRootTypes());
         $bindValues['aggregateRootTypes'] = $aggregateRootTypeContractNames;
         $bindValueTypes['aggregateRootTypes'] = Connection::PARAM_STR_ARRAY;
     }
     if ($criteria->getAggregateRootIds()) {
         $criteriaTypes[] = 'aggregate_root_id IN (:aggregateRootIds)';
         $bindValues['aggregateRootIds'] = $criteria->getAggregateRootIds();
         $bindValueTypes['aggregateRootIds'] = Connection::PARAM_STR_ARRAY;
     }
     if ($criteria->getEventTypes()) {
         $criteriaTypes[] = 'event_type IN (:eventTypes)';
         $eventTypeContractNames = array_map(function (Contract $eventType) {
             return $eventType->getContractName();
         }, $criteria->getEventTypes());
         $bindValues['eventTypes'] = $eventTypeContractNames;
         $bindValueTypes['eventTypes'] = Connection::PARAM_STR_ARRAY;
     }
     if (!$criteriaTypes) {
         return array('', [], []);
     }
     $where = 'WHERE ' . join(' AND ', $criteriaTypes);
     return array($where, $bindValues, $bindValueTypes);
 }