3 namespace wcf\system\comment\manager;
5 use wcf\data\person\Person;
6 use wcf\data\person\PersonEditor;
7 use wcf\system\cache\runtime\PersonRuntimeCache;
11 * Comment manager implementation for people.
13 * @author Matthias Schmidt
14 * @copyright 2001-2021 WoltLab GmbH
15 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
16 * @package WoltLabSuite\Core\System\Comment\Manager
18 class PersonCommentManager extends AbstractCommentManager
23 protected $permissionAdd = 'user.person.canAddComment';
28 protected $permissionAddWithoutModeration = 'user.person.canAddCommentWithoutModeration';
33 protected $permissionCanModerate = 'mod.person.canModerateComment';
38 protected $permissionDelete = 'user.person.canDeleteComment';
43 protected $permissionEdit = 'user.person.canEditComment';
48 protected $permissionModDelete = 'mod.person.canDeleteComment';
53 protected $permissionModEdit = 'mod.person.canEditComment';
58 public function getLink($objectTypeID, $objectID)
60 return PersonRuntimeCache::getInstance()->getObject($objectID)->getLink();
66 public function isAccessible($objectID, $validateWritePermission = false)
68 return PersonRuntimeCache::getInstance()->getObject($objectID) !== null;
74 public function getTitle($objectTypeID, $objectID, $isResponse = false)
77 return WCF::getLanguage()->get('wcf.person.commentResponse');
80 return WCF::getLanguage()->getDynamicVariable('wcf.person.comment');
86 public function updateCounter($objectID, $value)
88 (new PersonEditor(new Person($objectID)))->updateCounters(['comments' => $value]);