From c08a1e6455101184f833f14544fd83f115de2777 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Sun, 17 Aug 2014 22:07:23 +0200
Subject: [PATCH] according to PHPDoc this function shall return the entity

---
 lib/public/appframework/db/mapper.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/public/appframework/db/mapper.php b/lib/public/appframework/db/mapper.php
index a23149e796..03f0fe3aa7 100644
--- a/lib/public/appframework/db/mapper.php
+++ b/lib/public/appframework/db/mapper.php
@@ -125,6 +125,7 @@ abstract class Mapper {
 	 * Updates an entry in the db from an entity
 	 * @throws \InvalidArgumentException if entity has no id
 	 * @param Entity $entity the entity that should be created
+	 * @return Entity the saved entity with the set id
 	 */
 	public function update(Entity $entity){
 		// if entity wasn't changed it makes no sense to run a db query
@@ -142,7 +143,7 @@ abstract class Mapper {
 
 		// get updated fields to save, fields have to be set using a setter to
 		// be saved
-		// dont update the id field
+		// do not update the id field
 		unset($properties['id']);
 
 		$columns = '';
@@ -171,6 +172,8 @@ abstract class Mapper {
 		array_push($params, $id);
 
 		$this->execute($sql, $params);
+
+		return $entity;
 	}
 
 
-- 
GitLab