protected function proceed() { switch ($this->action) { case 'get': $this->succeed(CategoriesService::get($this->params['id'])); break; case 'getChildren': $this->succeed(CategoriesService::getChildren($this->params['parentId'])); break; case 'getAll': $this->succeed(CategoriesService::getAll()); break; } }