Skip to content
Permalink
Browse files

Remove duplicate code.

This code was causing conditions ending in `IS IS`. Remove it as we
don't need it now.
  • Loading branch information...
markstory committed May 16, 2016
1 parent 3943052 commit 010f727c7cab64890273f9acbf5423c1cf9af3bd
Showing with 1 addition and 10 deletions.
  1. +1 −10 src/ORM/Rule/IsUnique.php
@@ -57,7 +57,7 @@ public function __invoke(EntityInterface $entity, array $options)
if (isset($options['allowMultipleNulls'])) {
$allowMultipleNulls = $options['allowMultipleNulls'] === true ? true : false;
}
$alias = $options['repository']->alias();
$conditions = $this->_alias($alias, $entity->extract($this->_fields));
if ($entity->isNew() === false) {
@@ -68,15 +68,6 @@ public function __invoke(EntityInterface $entity, array $options)
}
}
if (!$allowMultipleNulls) {
foreach ($conditions as $key => $value) {
if ($value === null) {
$conditions[$key . ' IS'] = $value;
unset($conditions[$key]);
}
}
}
return !$options['repository']->exists($conditions);
}

0 comments on commit 010f727

Please sign in to comment.
You can’t perform that action at this time.