summaryrefslogtreecommitdiffstats
path: root/businesslayer/feedbusinesslayer.php
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-05-02 19:40:10 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-05-02 19:40:10 +0200
commit5ae697ac9dbaf999d51fa7805078249f33c301dc (patch)
treea4f408c9462ff4353820e266efad4864043d08f2 /businesslayer/feedbusinesslayer.php
parente9878cb5b583bc993a9f3a482d0b371bbeea5bd2 (diff)
added proper exception handling for all controllers and businesslayer
Diffstat (limited to 'businesslayer/feedbusinesslayer.php')
-rw-r--r--businesslayer/feedbusinesslayer.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/businesslayer/feedbusinesslayer.php b/businesslayer/feedbusinesslayer.php
index aba234989..284147242 100644
--- a/businesslayer/feedbusinesslayer.php
+++ b/businesslayer/feedbusinesslayer.php
@@ -62,11 +62,15 @@ class FeedBusinessLayer extends BusinessLayer {
}
+ /**
+ * @throws BusinessLayerExistsException if the feed exists already
+ * @throws BusinessLayerException if the url points to an invalid feed
+ */
public function create($feedUrl, $folderId, $userId){
// first try if the feed exists already
try {
$this->mapper->findByUrlHash(md5($feedUrl), $userId);
- throw new BusinessLayerException(
+ throw new BusinessLayerExistsException(
$this->api->getTrans()->t('Can not add feed: Exists already'));
} catch(DoesNotExistException $ex){}
@@ -123,6 +127,9 @@ class FeedBusinessLayer extends BusinessLayer {
}
+ /**
+ * @throws BusinessLayerException if the feed does not exist
+ */
public function update($feedId, $userId){
try {
$existingFeed = $this->mapper->find($feedId, $userId);
@@ -179,6 +186,9 @@ class FeedBusinessLayer extends BusinessLayer {
}
+ /**
+ * @throws BusinessLayerException if the feed does not exist
+ */
public function move($feedId, $folderId, $userId){
$feed = $this->find($feedId, $userId);
$feed->setFolderId($folderId);