backend\models\RejectApplyForm::__construct PHP Метод

__construct() публичный Метод

Creates a form model given an apply id.
public __construct ( string $id, array $config = [] )
$id string
$config array name-value pairs that will be used to initialize the object properties
    public function __construct($id, $config = [])
    {
        if (empty($id) || !is_numeric($id)) {
            throw new InvalidParamException('参数错误!');
        }
        $this->_apply = Apply::findOne($id);
        if (!$this->_apply) {
            throw new InvalidParamException('未找到该申请!');
        }
        if ($this->_apply->status !== Apply::STATUS_PENDING) {
            throw new InvalidParamException('请求错误!');
        }
        parent::__construct($config);
    }