2020-04-21 20:37:42 +00:00
|
|
|
<?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.
|
|
|
|
*/
|
|
|
|
|
2020-04-21 21:45:26 +00:00
|
|
|
namespace OCA\Epubreader\Db;
|
2020-04-21 20:37:42 +00:00
|
|
|
|
|
|
|
class Preference extends ReaderEntity implements \JsonSerializable {
|
|
|
|
|
2023-06-16 14:58:23 +00:00
|
|
|
protected $userId; // user for whom this preference is valid
|
|
|
|
protected $scope; // scope (default or specific renderer)
|
|
|
|
protected $fileId; // file for which this preference is set
|
|
|
|
protected $name; // preference name
|
|
|
|
protected $value; // preference value
|
|
|
|
protected $lastModified; // modification timestamp
|
|
|
|
|
|
|
|
public function jsonSerialize(): array {
|
|
|
|
return [
|
|
|
|
'id' => $this->getId(),
|
|
|
|
'scope' => $this->getScope(),
|
|
|
|
'fileId' => $this->getFileId(),
|
|
|
|
'name' => $this->getName(),
|
|
|
|
'value' => $this->conditional_json_decode($this->getValue()),
|
|
|
|
'lastModified' => $this->getLastModified(),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function toService() {
|
|
|
|
return [
|
|
|
|
'name' => $this->getName(),
|
|
|
|
'value' => $this->conditional_json_decode($this->getValue()),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getUserId() {
|
|
|
|
return $this->userId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setUserId($userId) {
|
|
|
|
$this->userId = $userId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getScope() {
|
|
|
|
return $this->scope;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setScope($scope) {
|
|
|
|
$this->scope = $scope;
|
|
|
|
}
|
2020-04-21 20:37:42 +00:00
|
|
|
|
2023-06-16 14:58:23 +00:00
|
|
|
public function getFileId() {
|
|
|
|
return $this->fileId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setFileId($fileId) {
|
|
|
|
$this->fileId = $fileId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName() {
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setName($name) {
|
|
|
|
$this->name = $name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getValue() {
|
|
|
|
return $this->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setValue($value) {
|
|
|
|
$this->value = $value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLastModified() {
|
|
|
|
return $this->lastModified;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setLastModified($lastModified) {
|
|
|
|
$this->lastModified = $lastModified;
|
|
|
|
}
|
|
|
|
}
|