models/Address.php
public function validateModelId($attribute, $params)
    {
        /** @var ActiveRecord $class */
        $class = Model::findIdentity($this->model_class);
        if ($class === null) {
            $this->addError($attribute, \Yii::t('net_frenzel_communication', 'ERROR_MSG_INVALID_MODEL_ID'));
        } else {
            $model = $class->name;
            if ($model::find()->where(['id' => $this->entity_id]) === false) {
                $this->addError($attribute, \Yii::t('net_frenzel_communication', 'ERROR_MSG_INVALID_MODEL_ID'));
            }
        }
    }
public function validateModelId($attribute, $params)
    {
        /** @var ActiveRecord $class */
        $class = Model::findIdentity($this->model_class);
        if ($class === null) {
            $this->addError($attribute, \Yii::t('net_frenzel_communication', 'ERROR_MSG_INVALID_MODEL_ID'));
        } else {
            $model = $class->name;
            if ($model::find()->where(['id' => $this->entity_id]) === false) {
                $this->addError($attribute, \Yii::t('net_frenzel_communication', 'ERROR_MSG_INVALID_MODEL_ID'));
            }
        }
    }
public function validateModelId ( $ attribute , $ params ) { /** @var ActiveRecord $class */ $ class = Model :: findIdentity ( $ this -> model_class ) ; if ( $ class === null ) { $ this -> addError ( $ attribute , \ Yii :: t ( 'net_frenzel_communication' , 'ERROR_MSG_INVALID_MODEL_ID' ) ) ; } else { $ model = $ class -> name ; if ( $ model :: find ( ) -> where ( [ 'id' => $ this -> entity_id ] ) === false ) { $ this -> addError ( $ attribute , \ Yii :: t ( 'net_frenzel_communication' , 'ERROR_MSG_INVALID_MODEL_ID' ) ) ; } } }
Model ID validation.

@param string $attribute Attribute name
@param array $params Attribute params

@return mixed
Model ID validation .