Commit 68f65a9f by Alexander Kochetov

ExistValidator bugfix

parent e7914368
......@@ -111,7 +111,7 @@ class ExistValidator extends Validator
$query = $this->createQuery($targetClass, $params);
if (is_array($object->$attribute)) {
if ($query->count("DISTINCT [[$targetAttribute]]") === count($object->$attribute)) {
if ($query->count("DISTINCT [[$targetAttribute]]") == count($object->$attribute)) {
return;
}
} 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