2016-03-09 05:15:44 +03:00
|
|
|
<?php
|
|
|
|
/**
|
2018-03-27 14:33:33 +03:00
|
|
|
* @copyright 2018, Roeland Jago Douma <roeland@famdouma.nl>
|
2016-03-09 05:15:44 +03:00
|
|
|
*
|
2018-03-27 14:33:33 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2016-03-09 05:15:44 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
namespace OCA\Richdocuments\Db;
|
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
use OCP\AppFramework\Db\Entity;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
/**
|
|
|
|
* Class WopiEntity
|
|
|
|
*
|
|
|
|
* @package OCA\Richdocuments\Db
|
|
|
|
*
|
|
|
|
* @method void setOwnerUid(string $uid)
|
|
|
|
* @method string getOwnerUid()
|
|
|
|
* @method void setEditorUid(string $uid)
|
|
|
|
* @method string getEditorUid()
|
|
|
|
* @method void setFileid(int $fileid)
|
|
|
|
* @method int getFileid()
|
|
|
|
* @method void setVersion(int $version)
|
|
|
|
* @method int getVersion()
|
|
|
|
* @method void setCanwrite(bool $canwrite)
|
|
|
|
* @method bool getCanwrite()
|
|
|
|
* @method void setServerHost(string $host)
|
|
|
|
* @method string getServerHost()
|
|
|
|
* @method void setToken(string $token)
|
|
|
|
* @method string getToken()
|
|
|
|
* @method void setExpiry(int $expiry)
|
|
|
|
* @method int getExpiry()
|
2018-06-13 16:31:18 +03:00
|
|
|
* @method void setGuestDisplayname(string $token)
|
|
|
|
* @method string getGuestDisplayname()
|
2018-10-08 16:36:20 +03:00
|
|
|
* @method void setTemplateDestination(int $fileId)
|
|
|
|
* @method int getTemplateDestination()
|
2018-03-27 14:33:33 +03:00
|
|
|
*/
|
|
|
|
class Wopi extends Entity {
|
|
|
|
/** @var string */
|
|
|
|
protected $ownerUid;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
/** @var string */
|
|
|
|
protected $editorUid;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
/** @var int */
|
|
|
|
protected $fileid;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
/** @var int */
|
|
|
|
protected $version;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
/** @var bool */
|
|
|
|
protected $canwrite;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
/** @var string */
|
|
|
|
protected $serverHost;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
/** @var string */
|
|
|
|
protected $token;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
/** @var int */
|
|
|
|
protected $expiry;
|
2016-03-09 05:15:44 +03:00
|
|
|
|
2018-06-13 16:31:18 +03:00
|
|
|
/** @var string */
|
|
|
|
protected $guestDisplayname;
|
|
|
|
|
2018-10-08 16:36:20 +03:00
|
|
|
/** @var int */
|
|
|
|
protected $templateDestination;
|
|
|
|
|
2018-03-27 14:33:33 +03:00
|
|
|
public function __construct() {
|
|
|
|
$this->addType('owner_uid', 'string');
|
|
|
|
$this->addType('editor_uid', 'string');
|
|
|
|
$this->addType('fileid', 'int');
|
|
|
|
$this->addType('version', 'int');
|
|
|
|
$this->addType('canwrite', 'bool');
|
|
|
|
$this->addType('server_host', 'string');
|
|
|
|
$this->addType('token', 'string');
|
|
|
|
$this->addType('expiry', 'int');
|
2018-06-13 16:31:18 +03:00
|
|
|
$this->addType('guest_displayname', 'string');
|
2018-10-08 21:44:52 +03:00
|
|
|
$this->addType('templateDestination', 'int');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isTemplateToken() {
|
|
|
|
return $this->getTemplateDestination() !== 0 && $this->getTemplateDestination() !== null;
|
2016-03-09 05:15:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|