<?php
namespace wcf\system\box;
+use wcf\data\condition\Condition;
use wcf\data\user\UserProfileList;
use wcf\data\DatabaseObject;
use wcf\system\cache\builder\MostActiveMembersCacheBuilder;
use wcf\system\cache\builder\MostLikedMembersCacheBuilder;
use wcf\system\cache\builder\NewestMembersCacheBuilder;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
+use wcf\system\condition\IObjectListCondition;
use wcf\system\event\EventHandler;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
protected function getObjectList() {
// use specialized cache builders
if ($this->sortOrder && $this->sortField && isset($this->cacheBuilders[$this->sortField])) {
+ $conditions = array_filter($this->box->getConditions(), function(Condition $condition) {
+ return $condition->getObjectType()->getProcessor() instanceof IObjectListCondition;
+ });
+
$this->userIDs = call_user_func([$this->cacheBuilders[$this->sortField], 'getInstance'])->getData([
- 'limit' => $this->limit,
- 'sortOrder' => $this->sortOrder
+ 'conditions' => $conditions,
+ 'limit' => $this->limit,
+ 'sortOrder' => $this->sortOrder,
]);
}
<?php
namespace wcf\system\cache\builder;
+use wcf\data\condition\Condition;
use wcf\data\user\UserList;
+use wcf\system\condition\IObjectListCondition;
/**
* Caches a list of the newest members.
if ($this->positiveValuesOnly) {
$userProfileList->getConditionBuilder()->add('user_table.'.$this->sortField.' > ?', [0]);
}
+ if (isset($parameters['conditions'])) {
+ /** @var Condition $condition */
+ foreach ($parameters['conditions'] as $condition) {
+ /** @var IObjectListCondition $processor */
+ $processor = $condition->getObjectType()->getProcessor();
+ $processor->addObjectListCondition($userProfileList, $condition->conditionData);
+ }
+ }
$userProfileList->sqlOrderBy = 'user_table.'.$this->sortField.' '.$sortOrder;
$userProfileList->sqlLimit = !empty($parameters['limit']) ? $parameters['limit'] : $this->defaultLimit;
$userProfileList->readObjectIDs();