mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Merge pull request #18716 from RodrigoDornelles/patch-1
use getTargetClass in function checkTargetAttributeExistence
This commit is contained in:
@ -169,7 +169,7 @@ class ExistValidator extends Validator
|
|||||||
$conditions[] = $params;
|
$conditions[] = $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
$targetClass = $this->targetClass === null ? get_class($model) : $this->targetClass;
|
$targetClass = $this->getTargetClass($model);
|
||||||
$query = $this->createQuery($targetClass, $conditions);
|
$query = $this->createQuery($targetClass, $conditions);
|
||||||
|
|
||||||
if (!$this->valueExists($targetClass, $query, $model->$attribute)) {
|
if (!$this->valueExists($targetClass, $query, $model->$attribute)) {
|
||||||
|
Reference in New Issue
Block a user