Store\Models\CancelOrderForm::__construct PHP Метод

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

Creates a form model given a order 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->_order = Order::findOne(['id' => $id, 'store_id' => Yii::$app->user->identity->store_id]);
        if (!$this->_order) {
            throw new InvalidParamException('您没有该订单!');
        }
        parent::__construct($config);
    }