ConditionHandler::getInstance()->updateConditions(
$this->box->boxID,
- $this->box->getConditions2(),
+ $this->box->getVisibilityConditions(),
$conditions
);
$this->readBoxImages();
- $conditions = $this->box->getConditions2();
+ $conditions = $this->box->getVisibilityConditions();
$conditionsByObjectTypeID = [];
foreach ($conditions as $condition) {
$conditionsByObjectTypeID[$condition->objectTypeID] = $condition;
}
/**
- * Returns the conditions of the notice.
+ * Returns the conditions for the box controller.
*
* @return Condition[]
+ * @deprecated since 5.5 - use self::getControllerConditions() instead
*/
public function getConditions()
+ {
+ return $this->getControllerConditions();
+ }
+
+ /**
+ * Returns the conditions for the box controller.
+ * The conditions are intended for the contents of the box.
+ *
+ * @return Condition[]
+ * @since 5.5
+ */
+ public function getControllerConditions()
{
/** @noinspection PhpUndefinedMethodInspection */
if ($this->boxType === 'system' && $this->getController() instanceof IConditionBoxController && $this->getController()->getConditionDefinition()) {
}
/**
- * @TODO
+ * Returns the conditions for the visibility of the box.
*
* @return Condition[]
* @since 5.5
*/
- public function getConditions2(): array // @TODO name
+ public function getVisibilityConditions(): array
{
return ConditionHandler::getInstance()->getConditions(
'com.woltlab.wcf.condition.box', // @TODO make const
public function isVisible(): bool
{
- $conditions = $this->getConditions2();
+ $conditions = $this->getVisibilityConditions();
foreach ($conditions as $condition) {
if (!$condition->getObjectType()->getProcessor()->showContent($condition)) {
return false;