passman/lib/Db/EntityJSONSerializer.php
2016-09-11 13:07:39 +02:00

20 lines
454 B
PHP

<?php
/**
* Nextcloud - passman
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Sander Brand <brantje@gmail.com>
* @copyright Sander Brand 2016
*/
namespace OCA\Passman\Db;
trait EntityJSONSerializer {
public function serializeFields($properties) {
$result = [];
foreach($properties as $property) {
$result[$property] = $this->$property;
}
return $result;
}
}