1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-05-01 01:34:07 +02:00
Nextcloud-News/lib/Db/EntityJSONSerializer.php
Sean Molenaar 35b53ecd40 OPML export command and fixes
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
2020-09-29 14:56:07 +02:00

35 lines
770 B
PHP

<?php
/**
* Nextcloud - News
*
* 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 2012 Alessandro Cosentino
* @copyright 2012-2014 Bernhard Posselt
*/
namespace OCA\News\Db;
trait EntityJSONSerializer
{
/**
* Serialize object properties.
*
* @param array $properties Serializable properties
*
* @return array
*/
public function serializeFields(array $properties): array
{
$result = [];
foreach ($properties as $property) {
$result[$property] = $this->$property;
}
return $result;
}
}