示例#1
0
 public function get($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');
         }
         $app = $this->appService->get($appId);
         // remove parameters
         $app['parameters'] = null;
         return $app;
     } else {
         throw new StatusCode\NotFoundException('Could not find app');
     }
 }
示例#2
0
 /**
  * Returns the GET response
  *
  * @return array|\PSX\Record\RecordInterface
  */
 protected function doGet()
 {
     return $this->appService->get((int) $this->getUriFragment('app_id'));
 }