Exemple #1
0
 public function delete($userId, $appId)
 {
     $app = $this->appTable->get($appId);
     if (!empty($app)) {
         if ($app['userId'] != $userId) {
             throw new StatusCode\BadRequestException('App does not belong to the user');
         }
         $this->appService->delete($appId);
     } else {
         throw new StatusCode\NotFoundException('Could not find app');
     }
 }
Exemple #2
0
 /**
  * Returns the DELETE response
  *
  * @param \PSX\Record\RecordInterface $record
  * @return array|\PSX\Record\RecordInterface
  */
 protected function doDelete($record)
 {
     $this->appService->delete((int) $this->getUriFragment('app_id'));
     return array('success' => true, 'message' => 'App successful deleted');
 }