2019-08-30 20:10:36 +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-08-30 20:10:36 +00:00
|
|
|
namespace OCA\Bookmarks\Db;
|
|
|
|
|
|
|
|
use OCP\AppFramework\Db\Entity;
|
|
|
|
|
2020-03-05 11:45:42 +00:00
|
|
|
/**
|
|
|
|
* Class Folder
|
|
|
|
*
|
|
|
|
* @package OCA\Bookmarks\Db
|
2021-01-20 16:38:11 +00:00
|
|
|
* @method string getTitle()
|
2020-03-05 11:45:42 +00:00
|
|
|
* @method setTitle(string $title)
|
2021-01-20 16:38:11 +00:00
|
|
|
* @method string getUserId()
|
2020-03-05 11:45:42 +00:00
|
|
|
* @method setUserId(string $userId)
|
|
|
|
*/
|
2019-10-15 15:31:32 +00:00
|
|
|
class Folder extends Entity {
|
2021-01-20 14:42:41 +00:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2019-08-30 20:10:36 +00:00
|
|
|
protected $title;
|
2021-01-20 14:42:41 +00:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
2019-08-30 20:10:36 +00:00
|
|
|
protected $userId;
|
|
|
|
|
2020-03-05 11:45:42 +00:00
|
|
|
public static $columns = ['id', 'title', 'user_id'];
|
2019-11-23 17:29:19 +00:00
|
|
|
|
2019-08-30 20:10:36 +00:00
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
// add types in constructor
|
|
|
|
$this->addType('title', 'string');
|
2019-10-26 12:10:49 +00:00
|
|
|
$this->addType('userId', 'string');
|
2019-08-30 20:10:36 +00:00
|
|
|
}
|
2019-10-26 12:10:49 +00:00
|
|
|
|
2021-01-20 14:42:41 +00:00
|
|
|
/**
|
2023-02-19 13:19:13 +00:00
|
|
|
* @return array{id: int, title: string, userId: string}
|
2021-01-20 14:42:41 +00:00
|
|
|
*/
|
2020-09-21 12:17:46 +00:00
|
|
|
public function toArray(): array {
|
2020-03-05 11:45:42 +00:00
|
|
|
return ['id' => $this->id, 'title' => $this->title, 'userId' => $this->userId];
|
2019-10-26 12:10:49 +00:00
|
|
|
}
|
2019-08-30 20:10:36 +00:00
|
|
|
}
|