return $this->categoryType;
}
+ /**
+ * Returns the name of the category type of this category.
+ *
+ * @return string
+ */
+ public function getCategoryTypeName() {
+ return CategoryHandler::getInstance()->getObjectType($this->objectTypeID)->objectType;
+ }
+
/**
* @see wcf\system\request\IRouteController::getID()
*/
return $categories;
}
+ /**
+ * Returns a list of accessible categories.
+ *
+ * @param string $objectType
+ * @param array $permissions filters categories by given permissions
+ * @return array<integer> comma separated category ids
+ */
+ public function getAccessibleCategoryIDs($objectType, array $permissions) {
+ $categoryIDs = array();
+ foreach ($this->getCategories($objectType) as $category) {
+ $result = true;
+ $categoryPermissions = CategoryPermissionHandler::getInstance()->getPermissions($category);
+ foreach ($permissions as $permission) {
+ $result = $result && !empty($categoryPermissions[$permission]);
+ }
+
+ if ($result) {
+ $categoryIDs[] = $category->categoryID;
+ }
+ }
+
+ return $categoryIDs;
+ }
+
/**
* Returns the category object with the given category id.
*