From: Matthias Schmidt Date: Wed, 18 May 2016 15:11:15 +0000 (+0200) Subject: Add AbstractMultiCategoryCondition X-Git-Tag: 3.0.0_Beta_1~1712 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=accff67c43a0bcb9bca5f3a6e897a80b8f5b458c;p=GitHub%2FWoltLab%2FWCF.git Add AbstractMultiCategoryCondition --- diff --git a/wcfsetup/install/files/lib/system/condition/AbstractMultiCategoryCondition.class.php b/wcfsetup/install/files/lib/system/condition/AbstractMultiCategoryCondition.class.php new file mode 100644 index 0000000000..0b2d42c111 --- /dev/null +++ b/wcfsetup/install/files/lib/system/condition/AbstractMultiCategoryCondition.class.php @@ -0,0 +1,54 @@ + + * @package com.woltlab.wcf + * @subpackage system.condition + * @category Community Framework + * @since 2.2 + */ +abstract class AbstractMultiCategoryCondition extends AbstractMultiSelectCondition { + /** + * name of the category object type + * @var string + */ + public $objectType = ''; + + /** + * name of category node tree class + * @var string + */ + public $nodeTreeClassname = CategoryNodeTree::class; + + /** + * @inheritDoc + */ + protected function getFieldElement() { + $categoryTree = (new $this->nodeTreeClassname($this->objectType))->getIterator(); + $categoryCount = iterator_count($categoryTree); + + $fieldElement = ''; + + return $fieldElement; + } + + /** + * @inheritDoc + */ + protected function getOptions() { + return CategoryHandler::getInstance()->getCategories($this->objectType); + } +}