*/
class ViewableApplicationList extends ApplicationList {
/**
- * @see \wcf\data\DatabaseObjectList::readObjects()
+ * @see \wcf\data\DatabaseObjectList::$decoratorClassName
*/
- public function readObjects() {
- parent::readObjects();
-
- foreach ($this->objects as &$application) {
- $application = new ViewableApplication($application);
- }
- unset($application);
- }
+ public $decoratorClassName = ViewableApplication::class;
}
*/
public $responseIDs = array();
+ /**
+ * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+ */
+ public $decoratorClassName = StructuredComment::class;
+
/**
* @see \wcf\data\DatabaseObjectList::$sqlLimit
*/
// fetch response ids
$responseIDs = $userIDs = array();
- foreach ($this->objects as &$comment) {
+ foreach ($this->objects as $comment) {
if (!$this->minCommentTime || $comment->time < $this->minCommentTime) $this->minCommentTime = $comment->time;
$commentResponseIDs = $comment->getResponseIDs();
foreach ($commentResponseIDs as $responseID) {
$userIDs[] = $comment->userID;
}
- $comment = new StructuredComment($comment);
$comment->setIsDeletable($this->commentManager->canDeleteComment($comment->getDecoratedObject()));
$comment->setIsEditable($this->commentManager->canEditComment($comment->getDecoratedObject()));
}
- unset($comment);
// fetch last responses
if (!empty($responseIDs)) {
*/
public $minResponseTime = 0;
+ /**
+ * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+ */
+ public $decoratorClassName = StructuredCommentResponse::class;
+
/**
* @see \wcf\data\DatabaseObjectList::$sqlLimit
*/
// get user ids
$userIDs = array();
- foreach ($this->objects as &$response) {
+ foreach ($this->objects as $response) {
if (!$this->minResponseTime || $response->time < $this->minResponseTime) $this->minResponseTime = $response->time;
$userIDs[] = $response->userID;
- $response = new StructuredCommentResponse($response);
$response->setIsDeletable($this->commentManager->canDeleteResponse($response->getDecoratedObject()));
$response->setIsEditable($this->commentManager->canEditResponse($response->getDecoratedObject()));
}
- unset($response);
// fetch user data and avatars
if (!empty($userIDs)) {
*/
public $className = 'wcf\data\like\Like';
+ /**
+ * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+ */
+ public $decoratorClassName = ViewableLike::class;
+
/**
* @see \wcf\data\DatabaseObjectList::$sqlLimit
*/
$likeGroups = array();
foreach ($this->objects as &$like) {
$userIDs[] = $like->userID;
- $like = new ViewableLike($like);
if (!isset($likeGroups[$like->objectTypeID])) {
$objectType = ObjectTypeCache::getInstance()->getObjectType($like->objectTypeID);
$likeGroups[$like->objectTypeID]['objects'][] = $like;
}
- unset($like);
// set user profiles
if (!empty($userIDs)) {
*/
public $loadUserProfiles = false;
+ /**
+ * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+ */
+ public $decoratorClassName = ViewableModerationQueue::class;
+
/**
* @see \wcf\data\DatabaseObjectList::$useQualifiedShorthand
*/
if (!empty($this->objects)) {
$objects = array();
foreach ($this->objects as &$object) {
- $object = new ViewableModerationQueue($object);
-
if (!isset($objects[$object->objectTypeID])) {
$objects[$object->objectTypeID] = array();
}
$objects[$object->objectTypeID][] = $object;
}
- unset($object);
foreach ($objects as $objectTypeID => $queueItems) {
ModerationQueueManager::getInstance()->populate($objectTypeID, $queueItems);
*/
public $className = 'wcf\data\user\activity\event\UserActivityEvent';
+ /**
+ * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+ */
+ public $decoratorClassName = ViewableUserActivityEvent::class;
+
/**
* @see \wcf\data\DatabaseObjectList::$sqlLimit
*/
$userIDs = array();
$eventGroups = array();
- foreach ($this->objects as &$event) {
+ foreach ($this->objects as $event) {
$userIDs[] = $event->userID;
- $event = new ViewableUserActivityEvent($event);
if (!isset($eventGroups[$event->objectTypeID])) {
$objectType = UserActivityEventHandler::getInstance()->getObjectType($event->objectTypeID);
$eventGroups[$event->objectTypeID]['objects'][] = $event;
}
- unset($event);
// set user profiles
if (!empty($userIDs)) {
*/
public $className = 'wcf\data\user\follow\UserFollow';
+ /**
+ * @see \wcf\data\DatabaseObjectList::$decoratorClassName
+ */
+ public $decoratorClassName = UserProfile::class;
+
/**
* @see \wcf\data\DatabaseObjectList::$objectClassName
*/
$this->sqlJoins .= " LEFT JOIN wcf".WCF_N."_user user_table ON (user_table.userID = user_follow.userID)";
$this->sqlJoins .= " LEFT JOIN wcf".WCF_N."_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
}
-
- /**
- * @see \wcf\data\DatabaseObjectList::readObjects()
- */
- public function readObjects() {
- parent::readObjects();
-
- foreach ($this->objects as &$object) {
- $object = new UserProfile($object);
- }
- }
}
// get label groups
$groupList = new LabelGroupList();
+ $groupList->decoratorClassName = ViewableLabelGroup::class;
$groupList->readObjects();
- $groups = $groupList->getObjects();
- foreach ($groups as &$group) {
- $data['groups'][$group->groupID] = new ViewableLabelGroup($group);
- }
- unset($group);
+ $data['groups'] = $groupList->getObjects();
// get permissions for groups
$permissions = ACLHandler::getInstance()->getPermissions(