2015-11-26 17:49:14 +03:00
|
|
|
<?php
|
2019-12-03 21:57:53 +03:00
|
|
|
|
2018-02-21 23:56:00 +03:00
|
|
|
declare(strict_types=1);
|
2019-12-03 21:57:53 +03:00
|
|
|
|
2015-11-26 17:49:14 +03:00
|
|
|
/**
|
2016-07-21 18:07:57 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
|
|
|
* @author Joas Schilling <coding@schilljs.com>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
2020-12-16 16:54:15 +03:00
|
|
|
* @author Vincent Petry <vincent@nextcloud.com>
|
2015-11-26 17:49:14 +03:00
|
|
|
*
|
|
|
|
* @license AGPL-3.0
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* 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, version 3,
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
2015-11-26 17:49:14 +03:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OC\SystemTag;
|
|
|
|
|
2015-11-30 12:12:15 +03:00
|
|
|
use OCP\SystemTag\ISystemTag;
|
2015-11-26 17:49:14 +03:00
|
|
|
|
2015-11-30 12:12:15 +03:00
|
|
|
class SystemTag implements ISystemTag {
|
2015-11-26 17:49:14 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $name;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
private $userVisible;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
private $userAssignable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*
|
|
|
|
* @param string $id tag id
|
|
|
|
* @param string $name tag name
|
|
|
|
* @param bool $userVisible whether the tag is user visible
|
|
|
|
* @param bool $userAssignable whether the tag is user assignable
|
|
|
|
*/
|
2018-02-21 23:56:00 +03:00
|
|
|
public function __construct(string $id, string $name, bool $userVisible, bool $userAssignable) {
|
2015-11-26 17:49:14 +03:00
|
|
|
$this->id = $id;
|
|
|
|
$this->name = $name;
|
|
|
|
$this->userVisible = $userVisible;
|
|
|
|
$this->userAssignable = $userAssignable;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2018-02-21 23:56:00 +03:00
|
|
|
public function getId(): string {
|
2015-11-26 17:49:14 +03:00
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2018-02-21 23:56:00 +03:00
|
|
|
public function getName(): string {
|
2015-11-26 17:49:14 +03:00
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2018-02-21 23:56:00 +03:00
|
|
|
public function isUserVisible(): bool {
|
2015-11-26 17:49:14 +03:00
|
|
|
return $this->userVisible;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2018-02-21 23:56:00 +03:00
|
|
|
public function isUserAssignable(): bool {
|
2015-11-26 17:49:14 +03:00
|
|
|
return $this->userAssignable;
|
|
|
|
}
|
|
|
|
}
|