2019-12-27 20:01:43 +00:00
|
|
|
<?php
|
2020-09-21 12:25:50 +00:00
|
|
|
/*
|
2024-02-02 18:27:50 +00:00
|
|
|
* Copyright (c) 2020-2024. The Nextcloud Bookmarks contributors.
|
2020-09-21 12:25:50 +00:00
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or later. See the COPYING file.
|
|
|
|
*/
|
2019-12-28 16:41:31 +00:00
|
|
|
|
2019-12-27 20:01:43 +00:00
|
|
|
namespace OCA\Bookmarks\Db;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Db\Entity;
|
|
|
|
|
2020-03-05 11:45:42 +00:00
|
|
|
/**
|
|
|
|
* Class SharedFolder
|
|
|
|
*
|
|
|
|
* @package OCA\Bookmarks\Db
|
|
|
|
*
|
2021-01-20 16:38:11 +00:00
|
|
|
* @method int getShareId()
|
2020-05-31 09:08:37 +00:00
|
|
|
* @method setFolderId(int $shareId)
|
2021-01-20 16:38:11 +00:00
|
|
|
* @method int getFolderId()
|
|
|
|
* @method string getUserId()
|
2020-03-05 11:45:42 +00:00
|
|
|
* @method setUserId(string $userId)
|
2021-01-20 16:38:11 +00:00
|
|
|
* @method string getTitle()
|
2020-03-05 11:45:42 +00:00
|
|
|
* @method setTitle(string $title)
|
|
|
|
*/
|
2019-12-27 20:01:43 +00:00
|
|
|
class SharedFolder extends Entity {
|
|
|
|
protected $shareId;
|
|
|
|
protected $userId;
|
2019-12-27 20:45:35 +00:00
|
|
|
protected $title;
|
2020-05-31 09:08:37 +00:00
|
|
|
protected $folderId;
|
2019-12-27 20:01:43 +00:00
|
|
|
|
2020-05-31 09:08:37 +00:00
|
|
|
public static $columns = ['id', 'user_id', 'title', 'folder_id'];
|
2019-12-27 20:01:43 +00:00
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
// add types in constructor
|
|
|
|
$this->addType('id', 'integer');
|
|
|
|
$this->addType('userId', 'string');
|
2020-05-31 09:08:37 +00:00
|
|
|
$this->addType('folderId', 'integer');
|
2019-12-27 20:45:35 +00:00
|
|
|
$this->addType('title', 'string');
|
2019-12-27 20:01:43 +00:00
|
|
|
}
|
|
|
|
|
2021-01-20 14:42:41 +00:00
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*
|
|
|
|
* @psalm-return array{title: mixed, userId: mixed}
|
|
|
|
*/
|
2020-09-21 12:17:46 +00:00
|
|
|
public function toArray(): array {
|
2020-05-26 16:09:51 +00:00
|
|
|
return ['title' => $this->title, 'userId' => $this->userId];
|
2019-12-27 20:01:43 +00:00
|
|
|
}
|
|
|
|
}
|