summaryrefslogtreecommitdiffstats
path: root/lib/Service/Service.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Service/Service.php')
-rw-r--r--lib/Service/Service.php30
1 files changed, 18 insertions, 12 deletions
diff --git a/lib/Service/Service.php b/lib/Service/Service.php
index e8fd4c72c..28cfeeb76 100644
--- a/lib/Service/Service.php
+++ b/lib/Service/Service.php
@@ -5,10 +5,10 @@
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
- * @author Alessandro Cosentino <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
+ * @author Alessandro Cosentino <cosenal@gmail.com>
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright 2012 Alessandro Cosentino
+ * @copyright 2012-2014 Bernhard Posselt
*/
namespace OCA\News\Service;
@@ -19,23 +19,27 @@ use \OCP\AppFramework\Db\MultipleObjectsReturnedException;
use \OCA\News\Db\NewsMapper;
-abstract class Service {
+abstract class Service
+{
protected $mapper;
- public function __construct(NewsMapper $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
+ *
+ * @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){
+ public function delete($id, $userId)
+ {
$entity = $this->find($id, $userId);
$this->mapper->delete($entity);
}
@@ -43,13 +47,15 @@ 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
+ *
+ * @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){
+ public function find($id, $userId)
+ {
try {
return $this->mapper->find($id, $userId);
} catch(DoesNotExistException $ex){