protected function getQueryArray($classMetadata, $value, $fieldName)
{
$field = $this->getFieldNameFromPropertyPath($fieldName);
if (!isset($classMetadata->fieldMappings[$field])) {
throw new \LogicException("Mapping for '{$fieldName}' doesn't exist for " . $this->class);
}
$mapping = $classMetadata->fieldMappings[$field];
if (isset($mapping['reference']) && $mapping['reference']) {
throw new \LogicException('Cannot determine uniqueness of referenced document values');
}
$criteria[$field] = $value instanceof UserInterface ? $classMetadata->getFieldValue($value, $field) : $value;
return $criteria;
}