diff options
-rw-r--r-- | db/imapper.php | 11 | ||||
-rw-r--r-- | service/service.php | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/db/imapper.php b/db/imapper.php index 5a5f0a3cc..9882060f0 100644 --- a/db/imapper.php +++ b/db/imapper.php @@ -13,10 +13,21 @@ namespace OCA\News\Db; +use \OCP\AppFramework\Db\Entity; + interface IMapper { + /** * @param int $id the id of the feed * @param string $userId the id of the user */ public function find($id, $userId); + + /** + * Delete an entity + * @param Entity $entity the entity that should be deleted + * @throws ServiceNotFoundException if the entity does not exist, or there + * are more than one of it + */ + public function delete(Entity $entity); }
\ No newline at end of file diff --git a/service/service.php b/service/service.php index 9609dd61e..cecd33687 100644 --- a/service/service.php +++ b/service/service.php @@ -32,8 +32,8 @@ abstract class Service { * Delete an entity * @param int $id the id of the entity * @param string $userId the name of the user for security reasons - * @throws DoesNotExistException if the entity does not exist - * @throws MultipleObjectsReturnedException if more than one entity exists + * @throws ServiceNotFoundException if the entity does not exist, or there + * are more than one of it */ public function delete($id, $userId){ $entity = $this->find($id, $userId); @@ -45,8 +45,8 @@ abstract class Service { * Finds an entity by id * @param int $id the id of the entity * @param string $userId the name of the user for security reasons - * @throws DoesNotExistException if the entity does not exist - * @throws MultipleObjectsReturnedException if more than one entity exists + * @throws ServiceNotFoundException if the entity does not exist, or there + * are more than one of it * @return Entity the entity */ public function find($id, $userId){ |