mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
UniqueValidator - fixed syntax warning: static call on object
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user