init() public method

public init ( )
Beispiel #1
0
 public function init()
 {
     $this->modelClass = UserProfile::className();
     $this->findModel = UserController::className() . '::' . UserController::METHOD_FIND_MODEL;
     $this->checkAccess = UserController::className() . '::' . UserController::METHOD_CHECK_ACCESS;
     parent::init();
 }
Beispiel #2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $params = Yii::$app->request->queryParams;
     if ($this->expectedParams($params) === false) {
         throw new InvalidConfigException("unexpected configurations.");
     }
     $this->relativeClass = $params['relativeClass'];
     $this->relationName = $params['relationName'];
     $this->linkAttribute = $params['linkAttribute'];
     $this->relative_id = $params[$this->linkAttribute];
 }
 /**
  * check request for errors and load items
  */
 public function init()
 {
     if (!$this->enable) {
         throw new MethodNotAllowedHttpException("Method Not Allowed");
     }
     $this->items = Yii::$app->getRequest()->getBodyParam($this->property);
     if (!is_array($this->items)) {
         throw new BadRequestHttpException("{$this->property} must be array");
     }
     if (count($this->items) > $this->limit) {
         throw new BadRequestHttpException("Request Entity Too Large", 413);
     }
     parent::init();
 }
Beispiel #4
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if ($this->controller instanceof ActiveController || $this->controller instanceof \yii\rest\ActiveController) {
         if ($this->modelClass === null) {
             $this->modelClass = $this->controller->modelClass;
         }
         if ($this->checkAccess === null) {
             $this->checkAccess = [$this->controller, 'checkAccess'];
         }
     }
     if ($this->viewName === null) {
         $this->viewName = $this->id;
     }
     parent::init();
 }
Beispiel #5
0
 /**
  *
  */
 public function init()
 {
     parent::init();
 }