summaryrefslogtreecommitdiffstats
path: root/lib/Controller/EntityApiSerializer.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Controller/EntityApiSerializer.php')
-rw-r--r--lib/Controller/EntityApiSerializer.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/Controller/EntityApiSerializer.php b/lib/Controller/EntityApiSerializer.php
index af126045e..f624eb84c 100644
--- a/lib/Controller/EntityApiSerializer.php
+++ b/lib/Controller/EntityApiSerializer.php
@@ -5,8 +5,8 @@
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Bernhard Posselt 2014
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright 2012-2014 Bernhard Posselt
*/
namespace OCA\News\Controller;
@@ -14,11 +14,13 @@ namespace OCA\News\Controller;
use \OCA\News\Db\IAPI;
-class EntityApiSerializer {
+class EntityApiSerializer
+{
private $level;
- public function __construct($level) {
+ public function __construct($level)
+ {
$this->level = $level;
}
@@ -26,14 +28,15 @@ class EntityApiSerializer {
/**
* Call toAPI() method on all entities. Works on
*
- * @param mixed $data :
- * * Entity
- * * Entity[]
- * * array('level' => Entity[])
- * * Response
+ * @param mixed $data :
+ * * Entity
+ * * Entity[]
+ * * array('level' => Entity[])
+ * * Response
* @return array|mixed
*/
- public function serialize($data) {
+ public function serialize($data)
+ {
if($data instanceof IAPI) {
return [$this->level => [$data->toAPI()]];
@@ -49,14 +52,15 @@ class EntityApiSerializer {
}
- private function convert($entities) {
+ private function convert($entities)
+ {
$converted = [];
foreach($entities as $entity) {
if($entity instanceof IAPI) {
$converted[] = $entity->toAPI();
- // break if it contains anything else than entities
+ // break if it contains anything else than entities
} else {
return $entities;
}