mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
use getTargetClass in function checkTargetAttributeExistence
This interesting change, to be able to change getTargetClass when necessary when extending this class.
This commit is contained in:
@ -169,7 +169,7 @@ class ExistValidator extends Validator
|
||||
$conditions[] = $params;
|
||||
}
|
||||
|
||||
$targetClass = $this->targetClass === null ? get_class($model) : $this->targetClass;
|
||||
$targetClass = $this->getTargetClass($model);
|
||||
$query = $this->createQuery($targetClass, $conditions);
|
||||
|
||||
if (!$this->valueExists($targetClass, $query, $model->$attribute)) {
|
||||
|
Reference in New Issue
Block a user