Exemplo n.º 1
0
 /**
  * Handles PATCH action
  *
  * @return \DreamFactory\Core\Utility\ServiceResponse
  * @throws BadRequestException
  * @throws \Exception
  */
 protected function handlePATCH()
 {
     if (!empty($this->resource)) {
         if ($this->request->getParameterAsBool(ApiOptions::REGENERATE)) {
             /** @var AppModel $appClass */
             $appClass = $this->model;
             $app = $appClass::find($this->resource)->first();
             $app->api_key = $appClass::generateApiKey($app->name);
             $app->save();
         }
     }
     return parent::handlePATCH();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function handlePATCH()
 {
     return $this->handleInvitation(parent::handlePATCH());
 }