Commit 68f65a9f by Alexander Kochetov

ExistValidator bugfix

parent e7914368
...@@ -111,7 +111,7 @@ class ExistValidator extends Validator ...@@ -111,7 +111,7 @@ class ExistValidator extends Validator
$query = $this->createQuery($targetClass, $params); $query = $this->createQuery($targetClass, $params);
if (is_array($object->$attribute)) { if (is_array($object->$attribute)) {
if ($query->count("DISTINCT [[$targetAttribute]]") === count($object->$attribute)) { if ($query->count("DISTINCT [[$targetAttribute]]") == count($object->$attribute)) {
return; return;
} }
} elseif ($query->exists()) { } elseif ($query->exists()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment