twigs-nextcloud/lib/Db/Budget.php
William Brawner 683fb07e48 Implement transaction REST operations
Signed-off-by: William Brawner <me@wbrawner.com>
2020-03-08 14:42:19 -05:00

29 lines
No EOL
622 B
PHP

<?php
namespace OCA\Twigs\Db;
use JsonSerializable;
use OCP\AppFramework\Db\Entity;
class Budget extends Entity implements JsonSerializable {
protected $name;
protected $description;
protected $users = [];
public function jsonSerialize() {
$users = [];
foreach ($this->users as $user) {
array_push(
$users,
$user->jsonSerialize()
);
}
return [
'id' => (int) $this->id,
'name' => $this->name,
'description' => $this->description,
'users' => $users
];
}
}