2 namespace wcf\system\category
;
3 use wcf\data\category\CategoryEditor
;
6 * Every category type has to implement this interface.
8 * @author Matthias Schmidt
9 * @copyright 2001-2018 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package WoltLabSuite\Core\System\Category
13 interface ICategoryType
{
15 * Is called right after the given category is deleted.
17 * @param CategoryEditor $categoryEditor
19 public function afterDeletion(CategoryEditor
$categoryEditor);
22 * Is called before the given category is deleted.
24 * @param CategoryEditor $categoryEditor
27 public function beforeDeletion(CategoryEditor
$categoryEditor);
30 * Returns true if the active user can add a category of this type.
34 public function canAddCategory();
37 * Returns true if the active user can delete a category of this type.
41 public function canDeleteCategory();
44 * Returns true if the active user can edit a category of this type.
48 public function canEditCategory();
51 * Is called after categories were assigned different parent categories.
56 * oldParentCategoryID => 1,
57 * newParentCategoryID => 2
60 * oldParentCategoryID => null,
61 * newParentCategoryID => 2
65 * @param array $categoryData
67 public function changedParentCategories(array $categoryData);
70 * Returns true if a category of this type may have no empty description.
74 public function forceDescription();
77 * Returns abbreviation of the application this category type belongs to.
81 public function getApplication();
84 * Returns the name of the object type of the definition with the given
85 * name for categories of this type or `null` if no such object type exists.
87 * @param string $definitionName
90 public function getObjectTypeName($definitionName);
93 * Returns the language variable category for the description language
94 * variables of categories of this type.
98 public function getDescriptionLangVarCategory();
101 * Returns the prefix used for language variables of i18n values.
105 public function getI18nLangVarPrefix();
108 * Returns the language variable value with the given name. The given name
109 * may not contain the language category prefix.
111 * If "{your.language.category}.list" is wanted, $name has to be "list".
112 * If the specific language variable for this category type doesn't exist,
113 * a fallback to the default variables (in this example "wcf.category.list")
116 * @param string $name
117 * @param boolean $optional
120 public function getLanguageVariable($name, $optional = false);
123 * Returns the maximum category nesting level for this type. "-1" means
124 * that there is no maximum.
128 public function getMaximumNestingLevel();
131 * Returns the language variable category for the title language variables
132 * of categories of this type.
136 public function getTitleLangVarCategory();
139 * Returns true if categories of this type have descriptions.
143 public function hasDescription();