1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-02 14:49:17 +02:00
nextcloud-apps/reader/lib/Db/Bookmark.php
2017-02-14 21:17:50 +01:00

34 lines
1 KiB
PHP

<?php
/**
* @author Frank de Lange
* @copyright 2015 Frank de Lange
*
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace OCA\Files_Reader\Db;
use OCP\AppFramework\Db\Entity;
class Bookmark extends ReaderEntity implements \JsonSerializable {
protected $userId; // user
protected $fileId; // book (identified by fileId) for which this mark is valid
protected $name; // name, defaults to $location
protected $value; // bookmark value (format-specific, eg. page number for PDF, CFI for epub, etc)
protected $lastModified; // modification timestamp
public function jsonSerialize() {
return [
'id' => $this->getId(),
'userId' => $this->getUserId(),
'fileId' => $this->getFileId(),
'name' => $this->getName(),
'value' => static::conditional_json_decode($this->getValue()),
'lastModified' => $this->getLastModified(),
];
}
}