3 namespace wcf\data\user\option\category
;
5 use wcf\data\DatabaseObject
;
6 use wcf\data\ITitledObject
;
10 * Represents a user option category.
13 * @copyright 2001-2019 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @package WoltLabSuite\Core\Data\User\Option\Category
17 * @property-read int $categoryID unique id of the user option category
18 * @property-read int $packageID id of the package which delivers the user option category
19 * @property-read string $categoryName name and textual identifier of the user option category
20 * @property-read string $parentCategoryName name of the user option category's parent category or empty if it has no parent category
21 * @property-read int $showOrder position of the user option category in relation to its siblings
22 * @property-read string $permissions comma separated list of user group permissions of which the active user needs to have at least one to see the user option category
23 * @property-read string $options comma separated list of options of which at least one needs to be enabled for the user option category to be shown
25 class UserOptionCategory
extends DatabaseObject
implements ITitledObject
28 * Returns the title of this category.
32 public function __toString()
34 return $this->categoryName
;
40 public function getTitle()
42 return WCF
::getLanguage()->get('wcf.user.option.category.' . $this->categoryName
);
46 * Returns an instance of UserOptionCategory by name.
48 * @param string $categoryName
49 * @return UserOptionCategory
51 public static function getCategoryByName($categoryName)
54 FROM wcf" . WCF_N
. "_user_option_category
55 WHERE categoryName = ?";
56 $statement = WCF
::getDB()->prepareStatement($sql);
57 $statement->execute([$categoryName]);
58 $row = $statement->fetchArray();
63 return new self(null, $row);