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'); } }
/** * Returns the GET response * * @return array|\PSX\Record\RecordInterface */ protected function doGet() { return $this->appService->get((int) $this->getUriFragment('app_id')); }