UniqueValidator - fixed syntax warning: static call on object

This commit is contained in:
SilverFire - Dmitry Naumenko
2016-01-19 00:18:58 +02:00
parent 6eb9830d64
commit a1ff095f91

View File

@ -106,8 +106,9 @@ class UniqueValidator extends Validator
$query->andWhere($this->filter);
}
if (!$model instanceof ActiveRecordInterface || $model->getIsNewRecord() || $model::className() !== $targetClass) {
if (!$model instanceof ActiveRecordInterface || $model->getIsNewRecord() || $model->className() !== $targetClass) {
// if current $model isn't in the database yet then it's OK just to call exists()
// also there's no need to run check based on primary keys, when $targetClass is not the same as $model's class
$exists = $query->exists();
} else {
// if current $model is in the database already we can't use exists()