Use AbstractDatabaseObjectAction::getObjects()
authorMatthias Schmidt <gravatronics@live.com>
Fri, 27 May 2016 06:54:20 +0000 (08:54 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 27 May 2016 09:48:12 +0000 (11:48 +0200)
… so that IDE can property determine the type of the objects as the
return value type of `getObjects()` is specified by `@method` tags.

33 files changed:
wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php
wcfsetup/install/files/lib/data/ad/AdAction.class.php
wcfsetup/install/files/lib/data/application/ApplicationAction.class.php
wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php
wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php
wcfsetup/install/files/lib/data/box/BoxAction.class.php
wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestionAction.class.php
wcfsetup/install/files/lib/data/category/CategoryAction.class.php
wcfsetup/install/files/lib/data/comment/CommentAction.class.php
wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php
wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php
wcfsetup/install/files/lib/data/label/LabelAction.class.php
wcfsetup/install/files/lib/data/language/LanguageAction.class.php
wcfsetup/install/files/lib/data/media/MediaAction.class.php
wcfsetup/install/files/lib/data/menu/MenuAction.class.php
wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php
wcfsetup/install/files/lib/data/notice/NoticeAction.class.php
wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php
wcfsetup/install/files/lib/data/page/PageAction.class.php
wcfsetup/install/files/lib/data/paid/subscription/PaidSubscriptionAction.class.php
wcfsetup/install/files/lib/data/paid/subscription/user/PaidSubscriptionUserAction.class.php
wcfsetup/install/files/lib/data/style/StyleAction.class.php
wcfsetup/install/files/lib/data/tag/TagAction.class.php
wcfsetup/install/files/lib/data/template/TemplateAction.class.php
wcfsetup/install/files/lib/data/user/UserAction.class.php
wcfsetup/install/files/lib/data/user/UserProfileAction.class.php
wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php
wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php
wcfsetup/install/files/lib/data/user/group/assignment/UserGroupAssignmentAction.class.php
wcfsetup/install/files/lib/data/user/ignore/UserIgnoreAction.class.php
wcfsetup/install/files/lib/data/user/option/UserOptionAction.class.php

index a7fe5f7a0e16d5a2f19a6d825d7f7c4892dcb723..406feb4a5b7e5be2c6daf37164791c6993a7fcd8 100644 (file)
@@ -249,7 +249,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                
                // update object IDs
                $this->objectIDs = [];
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        $this->objectIDs[] = $object->getObjectID();
                }
        }
@@ -348,7 +348,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                
                // get ids
                $objectIDs = [];
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        $objectIDs[] = $object->getObjectID();
                }
                
@@ -365,13 +365,13 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                }
                
                if (isset($this->parameters['data'])) {
-                       foreach ($this->objects as $object) {
+                       foreach ($this->getObjects() as $object) {
                                $object->update($this->parameters['data']);
                        }
                }
                
                if (isset($this->parameters['counters'])) {
-                       foreach ($this->objects as $object) {
+                       foreach ($this->getObjects() as $object) {
                                $object->updateCounters($this->parameters['counters']);
                        }
                }
index b5d3823f6150194706ba3f62fd00971d661c13f0..913bbfab66c7376a9d97329d63a24b4c8100f663 100644 (file)
@@ -68,7 +68,7 @@ class AdAction extends AbstractDatabaseObjectAction implements ISortableAction,
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $ad) {
+               foreach ($this->getObjects() as $ad) {
                        $ad->update([
                                'isDisabled' => $ad->isDisabled ? 0 : 1
                        ]);
index ad933eb8b7f9728f7aad666ecc0e0a448fbbad93..1644a8cf108f12893d8e038d89157acbf19dc774 100644 (file)
@@ -51,7 +51,7 @@ class ApplicationAction extends AbstractDatabaseObjectAction {
                // calculate cookie path
                $domains = [];
                $regex = new Regex(':[0-9]+');
-               foreach ($this->objects as $application) {
+               foreach ($this->getObjects() as $application) {
                        $domainName = $application->domainName;
                        if (StringUtil::endsWith($regex->replace($domainName, ''), $application->cookieDomain)) {
                                $domainName = $application->cookieDomain;
index 09d534e2148541ff38b0003728a6d1dc01e7545c..67aaa9afc917a11af260aa93d6081ded2c2b6d56 100644 (file)
@@ -66,7 +66,7 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable
                        }
                }
                
-               foreach ($this->objects as $attachment) {
+               foreach ($this->getObjects() as $attachment) {
                        if ($attachment->tmpHash) {
                                if ($attachment->userID != WCF::getUser()->userID) {
                                        throw new PermissionDeniedException();
@@ -198,7 +198,7 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable
                
                $saveStrategy = new DefaultUploadFileSaveStrategy(self::class);
                
-               foreach ($this->objects as $attachment) {
+               foreach ($this->getObjects() as $attachment) {
                        if (!$attachment->isImage) {
                                // create thumbnails for every file that isn't an image
                                $this->eventAttachment = $attachment;
index 5ce1d7f75b9801a37a053e336afe68930aac8403..ffeab34a875b0c55f11d8cd729262cf58bdb8aca 100644 (file)
@@ -106,7 +106,7 @@ class BBCodeAction extends AbstractDatabaseObjectAction implements IToggleAction
        public function validateDelete() {
                parent::validateDelete();
                
-               foreach ($this->objects as $bbcode) {
+               foreach ($this->getObjects() as $bbcode) {
                        if (!$bbcode->canDelete()) {
                                throw new PermissionDeniedException();
                        }
@@ -124,7 +124,7 @@ class BBCodeAction extends AbstractDatabaseObjectAction implements IToggleAction
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $bbcode) {
+               foreach ($this->getObjects() as $bbcode) {
                        $bbcode->update([
                                'isDisabled' => $bbcode->isDisabled ? 0 : 1
                        ]);
index 48b53e3f165d8dd17b6a59ada7cba5a539d8843f..ba4d70e937377c583cd41b7ee042d61a733ccced 100644 (file)
@@ -125,7 +125,7 @@ class BoxAction extends AbstractDatabaseObjectAction {
                                VALUES          (?, ?, ?, ?, ?)";
                        $insertStatement = WCF::getDB()->prepareStatement($sql);
                        
-                       foreach ($this->objects as $box) {
+                       foreach ($this->getObjects() as $box) {
                                $deleteStatement->execute([$box->boxID]);
                                
                                foreach ($this->parameters['content'] as $languageID => $content) {
@@ -158,7 +158,7 @@ class BoxAction extends AbstractDatabaseObjectAction {
                                VALUES          (?, ?, ?)";
                        $insertStatement = WCF::getDB()->prepareStatement($sql);
                        
-                       foreach ($this->objects as $box) {
+                       foreach ($this->getObjects() as $box) {
                                $deleteStatement->execute([$box->boxID]);
                                $visibleEverywhere = (isset($this->parameters['data']['visibleEverywhere']) ? $this->parameters['data']['visibleEverywhere'] : $box->visibleEverywhere);
                                
@@ -175,7 +175,7 @@ class BoxAction extends AbstractDatabaseObjectAction {
        public function validateDelete() {
                parent::validateDelete();
                
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        if (!$object->canDelete()) {
                                throw new PermissionDeniedException();
                        }
@@ -186,7 +186,7 @@ class BoxAction extends AbstractDatabaseObjectAction {
         * @inheritDoc
         */
        public function delete() {
-               foreach ($this->objects as $box) {
+               foreach ($this->getObjects() as $box) {
                        if ($box->boxType == 'tpl') {
                                foreach ($box->getBoxContent() as $languageID => $content) {
                                        $file = WCF_DIR . 'templates/' . $box->getTplName(($languageID ?: null)) . '.tpl';
index bf0e833eca65674ce88aa3fa2846f04e83004bf1..2f968e0b9bfa4953d0be083ec2bbbe85c044cdf7 100644 (file)
@@ -32,7 +32,7 @@ class CaptchaQuestionAction extends AbstractDatabaseObjectAction implements ITog
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $question) {
+               foreach ($this->getObjects() as $question) {
                        $question->update([
                                'isDisabled' => $question->isDisabled ? 0 : 1
                        ]);
index 0bc6fa6b902f09e8c094b621e8af16c6c143a09e..fdce42714bd9cdd6ac553de58bb6c610b1279ec7 100644 (file)
@@ -44,7 +44,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
                $returnValue = parent::delete();
                
                // call category types
-               foreach ($this->objects as $categoryEditor) {
+               foreach ($this->getObjects() as $categoryEditor) {
                        $categoryEditor->getProcessor()->afterDeletion($categoryEditor);
                }
                
@@ -55,7 +55,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $categoryEditor) {
+               foreach ($this->getObjects() as $categoryEditor) {
                        $categoryEditor->update([
                                'isDisabled' => 1 - $categoryEditor->isDisabled
                        ]);
@@ -100,7 +100,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
                        $objectType = null;
                        $parentUpdates = [];
                        
-                       foreach ($this->objects as $category) {
+                       foreach ($this->getObjects() as $category) {
                                if ($objectType === null) {
                                        $objectType = $category->getObjectType();
                                }
@@ -183,7 +183,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
                        }
                }
                
-               foreach ($this->objects as $categoryEditor) {
+               foreach ($this->getObjects() as $categoryEditor) {
                        if (!$categoryEditor->getProcessor()->canDeleteCategory()) {
                                throw new PermissionDeniedException();
                        }
@@ -217,7 +217,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
                        }
                }
                
-               foreach ($this->objects as $categoryEditor) {
+               foreach ($this->getObjects() as $categoryEditor) {
                        if (!$categoryEditor->getProcessor()->canEditCategory()) {
                                throw new PermissionDeniedException();
                        }
index 790599f14e5d2f65a14a7741ba927ae36c085a5e..2185311d2043e536bd7911fc0d119568b9a81ce1 100644 (file)
@@ -102,7 +102,7 @@ class CommentAction extends AbstractDatabaseObjectAction {
                // update counters
                $processors = [];
                $groupCommentIDs = $commentIDs = [];
-               foreach ($this->objects as $comment) {
+               foreach ($this->getObjects() as $comment) {
                        if (!isset($processors[$comment->objectTypeID])) {
                                $objectType = ObjectTypeCache::getInstance()->getObjectType($comment->objectTypeID);
                                $processors[$comment->objectTypeID] = $objectType->getProcessor();
index b984c6b4dd8649a23923bb02a2a91820ca3e9a88..1f135ba97ffb6807d5f3630d7a60e96942a5eaa9 100644 (file)
@@ -65,7 +65,7 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
                
                // read object type ids for comments
                $commentIDs = [];
-               foreach ($this->objects as $response) {
+               foreach ($this->getObjects() as $response) {
                        $commentIDs[] = $response->commentID;
                }
                
@@ -76,7 +76,7 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
                
                // update counters
                $processors = $responseIDs = $updateComments = [];
-               foreach ($this->objects as $response) {
+               foreach ($this->getObjects() as $response) {
                        $objectTypeID = $comments[$response->commentID]->objectTypeID;
                        
                        if (!isset($processors[$objectTypeID])) {
index 07446cde4aef4cafe568ef8a95bd5201ff1a8f3a..4c0b274fdeaa20ed6afefc9eee72ea707be3f66c 100644 (file)
@@ -60,7 +60,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
        public function validateDelete() {
                parent::validateDelete();
                
-               foreach ($this->objects as $cronjob) {
+               foreach ($this->getObjects() as $cronjob) {
                        if (!$cronjob->isDeletable()) {
                                throw new PermissionDeniedException();
                        }
@@ -73,7 +73,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
        public function validateUpdate() {
                parent::validateUpdate();
                
-               foreach ($this->objects as $cronjob) {
+               foreach ($this->getObjects() as $cronjob) {
                        if (!$cronjob->isEditable()) {
                                throw new PermissionDeniedException();
                        }
@@ -86,7 +86,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
        public function validateToggle() {
                parent::validateUpdate();
                
-               foreach ($this->objects as $cronjob) {
+               foreach ($this->getObjects() as $cronjob) {
                        if (!$cronjob->canBeDisabled()) {
                                throw new PermissionDeniedException();
                        }
@@ -97,7 +97,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $cronjob) {
+               foreach ($this->getObjects() as $cronjob) {
                        $cronjob->update([
                                'isDisabled' => $cronjob->isDisabled ? 0 : 1
                        ]);
@@ -117,12 +117,12 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
        public function execute() {
                $return = [];
                
-               foreach ($this->objects as $key => $cronjob) {
+               foreach ($this->getObjects() as $key => $cronjob) {
                        // mark them as pending
                        $cronjob->update(['state' => Cronjob::PENDING]);
                }
                
-               foreach ($this->objects as $cronjob) {
+               foreach ($this->getObjects() as $cronjob) {
                        // it now time for executing
                        $cronjob->update(['state' => Cronjob::EXECUTING]);
                        $className = $cronjob->className;
index ab7860add1b02deda660bf1e57f00870bbdd6487..4dac5e79fb7386fd403f229e7615ff833f780c1c 100644 (file)
@@ -89,7 +89,7 @@ class LabelAction extends AbstractDatabaseObjectAction implements ISortableActio
                if (!empty($this->objects)) {
                        // identify i18n labels
                        $languageVariables = [];
-                       foreach ($this->objects as $object) {
+                       foreach ($this->getObjects() as $object) {
                                if (preg_match('~wcf.acp.label.label\d+~', $object->label)) {
                                        $languageVariables[] = $object->label;
                                }
index 72a443f81cbbd6a90f20c26d6c0a21f9320bd7de..7f445e4c2692b76400f35b403268534296168ed0 100644 (file)
@@ -72,7 +72,7 @@ class LanguageAction extends AbstractDatabaseObjectAction implements IToggleActi
        public function validateToggle() {
                parent::validateUpdate();
                
-               foreach ($this->objects as $language) {
+               foreach ($this->getObjects() as $language) {
                        if ($language->isDefault) {
                                throw new UserInputException('objectIDs');
                        }
@@ -83,7 +83,7 @@ class LanguageAction extends AbstractDatabaseObjectAction implements IToggleActi
         * @inheritdoc
         */
        public function toggle() {
-               foreach ($this->objects as $language) {
+               foreach ($this->getObjects() as $language) {
                        $isDisabled = ($language->isDisabled) ? 0 : 1;
                        $language->update(['isDisabled' => $isDisabled]);
                }
index dec6f43f8f59b3bd2122055f993eac917f2a4b31..d81a1c1af2890fb10c32e0d1b0231fc3a713dee7 100644 (file)
@@ -442,8 +442,7 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction,
                        $this->readObjects();
                }
                
-               /** @var MediaEditor $mediaEditor */
-               foreach ($this->objects as $mediaEditor) {
+               foreach ($this->getObjects() as $mediaEditor) {
                        $mediaEditor->deleteFiles();
                }
                
@@ -460,7 +459,7 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction,
         */
        protected function unmarkItems(array $mediaIDs = []) {
                if (empty($mediaIDs)) {
-                       foreach ($this->objects as $media) {
+                       foreach ($this->getObjects() as $media) {
                                $mediaIDs[] = $media->mediaID;
                        }
                }
index 09a49283401fcab9940e64bec165419371004056..5fc61db58a0a0caa39fbf9c40730d513aa3739d8 100644 (file)
@@ -76,7 +76,7 @@ class MenuAction extends AbstractDatabaseObjectAction {
        public function validateDelete() {
                parent::validateDelete();
                
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        if (!$object->canDelete()) {
                                throw new PermissionDeniedException();
                        }
index 48c976ca3b03d877ed7178f27d45ed0a8454c70b..cb9176cd32e7addb32681bece6eca98d6ddb8aac 100644 (file)
@@ -55,7 +55,7 @@ class MenuItemAction extends AbstractDatabaseObjectAction implements ISortableAc
        public function validateToggle() {
                parent::validateUpdate();
        
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        if (!$object->canDisable()) {
                                throw new PermissionDeniedException();
                        }
@@ -66,7 +66,7 @@ class MenuItemAction extends AbstractDatabaseObjectAction implements ISortableAc
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        $object->update(['isDisabled' => ($object->isDisabled) ? 0 : 1]);
                }
        }
index a527622df4ca0b54138aff915631114a32a45f25..a753ce49748f4be0b8133a9c16110493404e1c6a 100644 (file)
@@ -75,7 +75,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                }
                
                $queueIDs = [];
-               foreach ($this->objects as $queue) {
+               foreach ($this->getObjects() as $queue) {
                        $queueIDs[] = $queue->queueID;
                }
                
@@ -291,7 +291,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $queue) {
+               foreach ($this->getObjects() as $queue) {
                        VisitTracker::getInstance()->trackObjectVisit('com.woltlab.wcf.moderation.queue', $queue->queueID, $this->parameters['visitTime']);
                }
                
@@ -316,7 +316,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $queue) {
+               foreach ($this->getObjects() as $queue) {
                        if (!$queue->canEdit()) {
                                throw new PermissionDeniedException();
                        }
index 85ae432a8c34f0c34a2ec850c5ad22d0301eb9d7..1bdcc52f74b540dd6c1dd8ad09869f573e474fe6 100644 (file)
@@ -112,7 +112,7 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $notice) {
+               foreach ($this->getObjects() as $notice) {
                        $notice->update([
                                'isDisabled' => $notice->isDisabled ? 0 : 1
                        ]);
index 3342288c0fdc740e75fbf63fc89968d2878ae3e0..00f94114fc07bfdad4f9aac37ba355290133b088 100644 (file)
@@ -54,7 +54,7 @@ class PackageUpdateServerAction extends AbstractDatabaseObjectAction implements
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $server) {
+               foreach ($this->getObjects() as $server) {
                        $server->update(['isDisabled' => ($server->isDisabled) ? 0 : 1]);
                }
        }
index 96f39f74e8b4f4db7659218bb076b8e88fe38ee6..a77034124ac942ede25bbc5796a275be4cb2206d 100644 (file)
@@ -126,7 +126,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
                                VALUES          (?, ?, ?, ?, ?, ?, ?)";
                        $insertStatement = WCF::getDB()->prepareStatement($sql);
                        
-                       foreach ($this->objects as $page) {
+                       foreach ($this->getObjects() as $page) {
                                $deleteStatement->execute([$page->pageID]);
                                
                                foreach ($this->parameters['content'] as $languageID => $content) {
@@ -161,7 +161,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
                                VALUES          (?, ?, ?)";
                        $insertStatement = WCF::getDB()->prepareStatement($sql);
                        
-                       foreach ($this->objects as $page) {
+                       foreach ($this->getObjects() as $page) {
                                $deleteStatement->execute([$page->pageID]);
                                
                                foreach ($this->parameters['boxToPage'] as $boxData) {
@@ -181,7 +181,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
        public function validateDelete() {
                parent::validateDelete();
                
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        if (!$object->canDelete()) {
                                throw new PermissionDeniedException();
                        }
@@ -194,7 +194,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
        public function validateToggle() {
                parent::validateUpdate();
                
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        if (!$object->canDisable()) {
                                throw new PermissionDeniedException();
                        }
@@ -205,7 +205,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        $object->update(['isDisabled' => ($object->isDisabled) ? 0 : 1]);
                }
        }
@@ -233,13 +233,13 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
         * @inheritDoc
         */
        public function delete() {
-               foreach ($this->objects as $page) {
+               foreach ($this->getObjects() as $page) {
                        if ($page->pageType == 'tpl') {
                                foreach ($page->getPageContent() as $languageID => $content) {
                                        $file = WCF_DIR . 'templates/' . $page->getTplName(($languageID ?: null)) . '.tpl';
                                        if (file_exists($file)) {
                                                @unlink($file);
-                                       }       
+                                       }
                                }
                        }
                }
index f249f30b11605f645a722816cf1345e688cedcc2..afb73350aa7c01d9db12681fab313729cba06947 100644 (file)
@@ -66,7 +66,7 @@ class PaidSubscriptionAction extends AbstractDatabaseObjectAction implements ITo
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        $object->update([
                                'isDisabled' => $object->isDisabled ? 0 : 1
                        ]);
index 3b9ed6121e9cae65bfee6f5b525ee529238d33c4..0667c1376a6047d78288eb906724bfaa09862130 100644 (file)
@@ -89,7 +89,7 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $subscriptionUser) {
+               foreach ($this->getObjects() as $subscriptionUser) {
                        $endDate = 0;
                        if (!isset($this->parameters['data']['endDate'])) {
                                $subscription = $subscriptionUser->getSubscription();
@@ -133,7 +133,7 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $subscriptionUser) {
+               foreach ($this->getObjects() as $subscriptionUser) {
                        $subscriptionUser->update(['isActive' => 0]);
                        
                        // update group memberships
@@ -150,7 +150,7 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $subscriptionUser) {
+               foreach ($this->getObjects() as $subscriptionUser) {
                        if (!$subscriptionUser->isActive) {
                                throw new UserInputException('objectIDs');
                        }
@@ -165,9 +165,9 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $subscriptionUser) {
+               foreach ($this->getObjects() as $subscriptionUser) {
                        $subscriptionUser->update(['isActive' => 1]);
-                               
+                       
                        // update group memberships
                        $action = new PaidSubscriptionUserAction([$subscriptionUser], 'addGroupMemberships');
                        $action->executeAction();
@@ -182,7 +182,7 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $subscriptionUser) {
+               foreach ($this->getObjects() as $subscriptionUser) {
                        if ($subscriptionUser->isActive) {
                                throw new UserInputException('objectIDs');
                        }
@@ -197,7 +197,7 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $subscriptionUser) {
+               foreach ($this->getObjects() as $subscriptionUser) {
                        $groupIDs = [];
                        foreach (explode(',', $subscriptionUser->getSubscription()->groupIDs) as $groupID) {
                                if (UserGroup::getGroupByID($groupID) !== null) {
@@ -223,7 +223,7 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $subscriptionUser) {
+               foreach ($this->getObjects() as $subscriptionUser) {
                        $groupIDs = [];
                        foreach (explode(',', $subscriptionUser->getSubscription()->groupIDs) as $groupID) {
                                if (UserGroup::getGroupByID($groupID) !== null) {
index 10ee604d6578b24cf02d3d4ff0adbb4983a5c671..1e26f142e52b4ff2586c7281462c2bb7ccdbebfa 100644 (file)
@@ -90,7 +90,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
        public function update() {
                parent::update();
                
-               foreach ($this->objects as $style) {
+               foreach ($this->getObjects() as $style) {
                        // update variables
                        $this->updateVariables($style->getDecoratedObject(), true);
                        
@@ -108,7 +108,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
        public function delete() {
                $count = parent::delete();
                
-               foreach ($this->objects as $style) {
+               foreach ($this->getObjects() as $style) {
                        // remove custom images
                        if ($style->imagePath && $style->imagePath != 'images/') {
                                $this->removeDirectory($style->imagePath);
@@ -581,7 +581,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
        public function validateToggle() {
                parent::validateUpdate();
                
-               foreach ($this->objects as $style) {
+               foreach ($this->getObjects() as $style) {
                        if ($style->isDefault) {
                                throw new UserInputException('objectIDs');
                        }
@@ -592,7 +592,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
         * @inheritdoc
         */
        public function toggle() {
-               foreach ($this->objects as $style) {
+               foreach ($this->getObjects() as $style) {
                        $isDisabled = ($style->isDisabled) ? 0 : 1;
                        $style->update(['isDisabled' => $isDisabled]);
                }
index 8a3ee604b781822b07d739c2af6053c81d3b42d7..e82cfe31748210385c0fefaae16c4e76e6335cc3 100644 (file)
@@ -142,7 +142,7 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction {
                        ]);
                }
                
-               foreach ($this->objects as $tagEditor) {
+               foreach ($this->getObjects() as $tagEditor) {
                        $this->tagEditor->addSynonym($tagEditor->getDecoratedObject());
                }
                
index e68519d099e87898cf9e2a4c2604901485c9c24d..81b4e1e5ef77567ed070cbaf19992ee126c88584 100644 (file)
@@ -75,7 +75,7 @@ class TemplateAction extends AbstractDatabaseObjectAction {
        public function update() {
                parent::update();
                
-               foreach ($this->objects as $template) {
+               foreach ($this->getObjects() as $template) {
                        // rename file
                        $templateName = (isset($this->parameters['data']['templateName']) ? $this->parameters['data']['templateName'] : $template->templateName);
                        $templateGroupID = (isset($this->parameters['data']['templateGroupID']) ? $this->parameters['data']['templateGroupID'] : $template->templateGroupID);
index 53ddb1b33f50004d73bc55e94891be018af5b6be..d3b87b15d06ccc7bd4e10e1db41656386351e96b 100644 (file)
@@ -125,7 +125,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                
                // delete avatars
                $avatarIDs = [];
-               foreach ($this->objects as $user) {
+               foreach ($this->getObjects() as $user) {
                        if ($user->avatarID) $avatarIDs[] = $user->avatarID;
                }
                if (!empty($avatarIDs)) {
@@ -309,7 +309,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        parent::update();
                        
                        if (isset($this->parameters['data']['languageID'])) {
-                               foreach ($this->objects as $object) {
+                               foreach ($this->getObjects() as $object) {
                                        if ($object->userID == WCF::getUser()->userID) {
                                                if ($this->parameters['data']['languageID'] != WCF::getUser()->languageID) {
                                                        WCF::setLanguage($this->parameters['data']['languageID']);
@@ -346,7 +346,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        $action->executeAction();
                }
                
-               foreach ($this->objects as $userEditor) {
+               foreach ($this->getObjects() as $userEditor) {
                        if (!empty($userOptions)) {
                                $userEditor->updateUserOptions($userOptions);
                        }
@@ -410,7 +410,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                
                $groupIDs = $this->parameters['groups'];
                
-               foreach ($this->objects as $userEditor) {
+               foreach ($this->getObjects() as $userEditor) {
                        $userEditor->removeFromGroups($groupIDs);
                }
                
@@ -442,7 +442,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                if (isset($this->parameters['deleteOldGroups'])) $deleteOldGroups = $this->parameters['deleteOldGroups'];
                if (isset($this->parameters['addDefaultGroups'])) $addDefaultGroups = $this->parameters['addDefaultGroups'];
                
-               foreach ($this->objects as $userEditor) {
+               foreach ($this->getObjects() as $userEditor) {
                        $userEditor->addToGroups($groupIDs, $deleteOldGroups, $addDefaultGroups);
                }
                
@@ -589,7 +589,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                
                // send e-mail notification
                if (empty($this->parameters['skipNotification'])) {
-                       foreach ($this->objects as $user) {
+                       foreach ($this->getObjects() as $user) {
                                $mail = new Mail([$user->username => $user->email], $user->getLanguage()->getDynamicVariable('wcf.acp.user.activation.mail.subject'), $user->getLanguage()->getDynamicVariable('wcf.acp.user.activation.mail', [
                                        'username' => $user->username
                                ]));
@@ -673,7 +673,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        $disableSignatureExpires = 0;
                }
                
-               foreach ($this->objects as $userEditor) {
+               foreach ($this->getObjects() as $userEditor) {
                        $userEditor->update([
                                'disableSignature' => 1,
                                'disableSignatureReason' => $this->parameters['disableSignatureReason'],
@@ -707,7 +707,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $userEditor) {
+               foreach ($this->getObjects() as $userEditor) {
                        $userEditor->update([
                                'disableSignature' => 0
                        ]);
@@ -740,7 +740,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        $disableAvatarExpires = 0;
                }
                
-               foreach ($this->objects as $userEditor) {
+               foreach ($this->getObjects() as $userEditor) {
                        $userEditor->update([
                                'disableAvatar' => 1,
                                'disableAvatarReason' => $this->parameters['disableAvatarReason'],
@@ -774,7 +774,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $userEditor) {
+               foreach ($this->getObjects() as $userEditor) {
                        $userEditor->update([
                                'disableAvatar' => 0
                        ]);
index 5bf1f9d59e912c3734f7a156c45570f403d16076..b7f513fe7e076a09c3f63d47733ebb07feeb1e9f 100644 (file)
@@ -320,7 +320,7 @@ class UserProfileAction extends UserAction {
                }
                
                $resetUserIDs = [];
-               foreach ($this->objects as $user) {
+               foreach ($this->getObjects() as $user) {
                        $conditionBuilder = new PreparedStatementConditionBuilder();
                        $conditionBuilder->add('user_rank.groupID IN (?)', [$user->getGroupIDs()]);
                        $conditionBuilder->add('user_rank.requiredPoints <= ?', [$user->activityPoints]);
@@ -364,7 +364,7 @@ class UserProfileAction extends UserAction {
                }
                
                $userToGroup = [];
-               foreach ($this->objects as $user) {
+               foreach ($this->getObjects() as $user) {
                        $conditionBuilder = new PreparedStatementConditionBuilder();
                        $conditionBuilder->add('groupID IN (?)', [$user->getGroupIDs()]);
                        
index 6738703db721550ac8c8189d0236f5f367eb17cb..a170115bcf3e50281a7634d15ac48dbe2e8ccbca 100644 (file)
@@ -156,7 +156,7 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $avatar) {
+               foreach ($this->getObjects() as $avatar) {
                        $adapter = ImageHandler::getInstance()->getAdapter();
                        $adapter->loadFile($avatar->getLocation());
                        
index ace89e95cc54466e58b1bbda5dd62d7bfdaab721..f82ccf1c602162849540bab5fff4a8c187503f92 100644 (file)
@@ -144,7 +144,7 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                }
                
                // validate ownership
-               foreach ($this->objects as $follow) {
+               foreach ($this->getObjects() as $follow) {
                        if ($follow->userID != WCF::getUser()->userID) {
                                throw new PermissionDeniedException();
                        }
@@ -158,7 +158,7 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                $returnValues = parent::delete();
                
                $followUserIDs = [];
-               foreach ($this->objects as $follow) {
+               foreach ($this->getObjects() as $follow) {
                        $followUserIDs[] = $follow->followUserID;
                        // remove activity event
                        UserActivityEventHandler::getInstance()->removeEvents('com.woltlab.wcf.user.recentActivityEvent.follow', [$follow->followUserID]);
index 0f7ba3ac8417d3e9e8650e4f842712f3b2d03a93..b2d9d715ead1f35d476b15feb4fe1cb2903490ac 100644 (file)
@@ -76,7 +76,7 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               foreach ($this->objects as $object) {
+               foreach ($this->getObjects() as $object) {
                        $object->update($this->parameters['data']);
                        $object->updateGroupOptions($this->parameters['options']);
                }
index d18d157c13152c99e5f16c5c13669ff15e295a07..60ab3660c1ae44318d595676987c8f42ff4434c4 100644 (file)
@@ -47,7 +47,7 @@ class UserGroupAssignmentAction extends AbstractDatabaseObjectAction implements
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $assignment) {
+               foreach ($this->getObjects() as $assignment) {
                        $assignment->update([
                                'isDisabled' => $assignment->isDisabled ? 0 : 1
                        ]);
index 6585e25df3ca32c241ee37c25813236a53bed56f..663d5507b9ad68f7d2726261853651be6911c8e8 100644 (file)
@@ -130,7 +130,7 @@ class UserIgnoreAction extends AbstractDatabaseObjectAction {
                }
                
                // validate ownership
-               foreach ($this->objects as $ignore) {
+               foreach ($this->getObjects() as $ignore) {
                        if ($ignore->userID != WCF::getUser()->userID) {
                                throw new PermissionDeniedException();
                        }
index 8a0cdf40113defb72a75e519e19ae37650a5d639..ac1da9dfb5d8e50f1d9f327681556bdfaaaba6c9 100644 (file)
@@ -50,7 +50,7 @@ class UserOptionAction extends AbstractDatabaseObjectAction implements IToggleAc
        public function validateDelete() {
                parent::validateDelete();
                
-               foreach ($this->objects as $userOption) {
+               foreach ($this->getObjects() as $userOption) {
                        if (!$userOption->canDelete()) {
                                throw new PermissionDeniedException();
                        }
@@ -61,7 +61,7 @@ class UserOptionAction extends AbstractDatabaseObjectAction implements IToggleAc
         * @inheritDoc
         */
        public function toggle() {
-               foreach ($this->objects as $optionEditor) {
+               foreach ($this->getObjects() as $optionEditor) {
                        $optionEditor->update([
                                'isDisabled' => 1 - $optionEditor->isDisabled
                        ]);