Beispiel #1
0
 /**
  * @param QChartsSubjectInterface $user
  * @param QueryRequest $queryRequest
  * @throws DatabaseException
  * @throws OverlappingException
  */
 public function addFavourite(QChartsSubjectInterface $user, QueryRequest $queryRequest)
 {
     try {
         $queryRequest->addFavoritedBy($user);
         $this->queryRepository->update($queryRequest);
     } catch (OverlappingException $e) {
         throw new OverlappingException("The given query is already in the given context", 555, $e);
     } catch (DatabaseException $e) {
         throw new DatabaseException("Error while adding to favorites, {$e->getMessage()}", 500, $e);
     }
 }