run() public method

Run REST controller
public run ( ) : mixed
return mixed
Example #1
0
 /**
  * Run REST controller
  * @return mixed
  * @throws ForbiddenException
  * @throws NotImplementedException
  */
 public function run()
 {
     $params = $this->params;
     if (sizeof($params)) {
         $this->primary = explode('-', array_shift($params));
     }
     if (sizeof($params)) {
         $this->relation = array_shift($params);
     }
     if (sizeof($params)) {
         $this->relationId = array_shift($params);
     }
     // OPTIONS
     if ('OPTIONS' == $this->method) {
         $this->data = array_keys($this->map);
     }
     // dispatch controller
     return parent::run();
 }