From 42d69a95f3276a2d6089ca68f635c4e2f6aa7a23 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 21 Oct 2014 16:45:36 +0200 Subject: convert tabs indention to indention with 4 spaces because of mixing of both variants in code and better readability on github and websites because you cant set the indention width there and 8 spaces will be used for a tab --- service/service.php | 74 ++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'service/service.php') diff --git a/service/service.php b/service/service.php index f3700de98..e53468828 100644 --- a/service/service.php +++ b/service/service.php @@ -21,42 +21,42 @@ use \OCA\News\Db\NewsMapper; abstract class Service { - protected $mapper; - - public function __construct(NewsMapper $mapper){ - $this->mapper = $mapper; - } - - - /** - * Delete an entity - * @param int $id the id of the entity - * @param string $userId the name of the user for security reasons - * @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); - $this->mapper->delete($entity); - } - - - /** - * 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 ServiceNotFoundException if the entity does not exist, or there - * are more than one of it - * @return \OCP\AppFramework\Db\Entity the entity - */ - public function find($id, $userId){ - try { - return $this->mapper->find($id, $userId); - } catch(DoesNotExistException $ex){ - throw new ServiceNotFoundException($ex->getMessage()); - } catch(MultipleObjectsReturnedException $ex){ - throw new ServiceNotFoundException($ex->getMessage()); - } - } + protected $mapper; + + public function __construct(NewsMapper $mapper){ + $this->mapper = $mapper; + } + + + /** + * Delete an entity + * @param int $id the id of the entity + * @param string $userId the name of the user for security reasons + * @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); + $this->mapper->delete($entity); + } + + + /** + * 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 ServiceNotFoundException if the entity does not exist, or there + * are more than one of it + * @return \OCP\AppFramework\Db\Entity the entity + */ + public function find($id, $userId){ + try { + return $this->mapper->find($id, $userId); + } catch(DoesNotExistException $ex){ + throw new ServiceNotFoundException($ex->getMessage()); + } catch(MultipleObjectsReturnedException $ex){ + throw new ServiceNotFoundException($ex->getMessage()); + } + } } -- cgit v1.2.3