bookmarks/lib/Db/Folder.php

47 lines
950 B
PHP
Raw Permalink Normal View History

<?php
2020-09-21 12:25: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.
*/
namespace OCA\Bookmarks\Db;
use OCP\AppFramework\Db\Entity;
2020-03-05 11:45:42 +00:00
/**
* Class Folder
*
* @package OCA\Bookmarks\Db
* @method string getTitle()
2020-03-05 11:45:42 +00:00
* @method setTitle(string $title)
* @method string getUserId()
2020-03-05 11:45:42 +00:00
* @method setUserId(string $userId)
*/
class Folder extends Entity {
/**
* @var string
*/
protected $title;
/**
* @var string
*/
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
public function __construct() {
// add types in constructor
$this->addType('title', 'string');
2019-10-26 12:10:49 +00:00
$this->addType('userId', 'string');
}
2019-10-26 12:10:49 +00:00
/**
* @return array{id: int, title: string, userId: string}
*/
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
}
}