// update object IDs
$this->objectIDs = [];
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
$this->objectIDs[] = $object->getObjectID();
}
}
// get ids
$objectIDs = [];
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
$objectIDs[] = $object->getObjectID();
}
}
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']);
}
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $ad) {
+ foreach ($this->getObjects() as $ad) {
$ad->update([
'isDisabled' => $ad->isDisabled ? 0 : 1
]);
// 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;
}
}
- foreach ($this->objects as $attachment) {
+ foreach ($this->getObjects() as $attachment) {
if ($attachment->tmpHash) {
if ($attachment->userID != WCF::getUser()->userID) {
throw new PermissionDeniedException();
$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;
public function validateDelete() {
parent::validateDelete();
- foreach ($this->objects as $bbcode) {
+ foreach ($this->getObjects() as $bbcode) {
if (!$bbcode->canDelete()) {
throw new PermissionDeniedException();
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $bbcode) {
+ foreach ($this->getObjects() as $bbcode) {
$bbcode->update([
'isDisabled' => $bbcode->isDisabled ? 0 : 1
]);
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) {
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);
public function validateDelete() {
parent::validateDelete();
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
if (!$object->canDelete()) {
throw new PermissionDeniedException();
}
* @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';
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $question) {
+ foreach ($this->getObjects() as $question) {
$question->update([
'isDisabled' => $question->isDisabled ? 0 : 1
]);
$returnValue = parent::delete();
// call category types
- foreach ($this->objects as $categoryEditor) {
+ foreach ($this->getObjects() as $categoryEditor) {
$categoryEditor->getProcessor()->afterDeletion($categoryEditor);
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $categoryEditor) {
+ foreach ($this->getObjects() as $categoryEditor) {
$categoryEditor->update([
'isDisabled' => 1 - $categoryEditor->isDisabled
]);
$objectType = null;
$parentUpdates = [];
- foreach ($this->objects as $category) {
+ foreach ($this->getObjects() as $category) {
if ($objectType === null) {
$objectType = $category->getObjectType();
}
}
}
- foreach ($this->objects as $categoryEditor) {
+ foreach ($this->getObjects() as $categoryEditor) {
if (!$categoryEditor->getProcessor()->canDeleteCategory()) {
throw new PermissionDeniedException();
}
}
}
- foreach ($this->objects as $categoryEditor) {
+ foreach ($this->getObjects() as $categoryEditor) {
if (!$categoryEditor->getProcessor()->canEditCategory()) {
throw new PermissionDeniedException();
}
// 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();
// read object type ids for comments
$commentIDs = [];
- foreach ($this->objects as $response) {
+ foreach ($this->getObjects() as $response) {
$commentIDs[] = $response->commentID;
}
// update counters
$processors = $responseIDs = $updateComments = [];
- foreach ($this->objects as $response) {
+ foreach ($this->getObjects() as $response) {
$objectTypeID = $comments[$response->commentID]->objectTypeID;
if (!isset($processors[$objectTypeID])) {
public function validateDelete() {
parent::validateDelete();
- foreach ($this->objects as $cronjob) {
+ foreach ($this->getObjects() as $cronjob) {
if (!$cronjob->isDeletable()) {
throw new PermissionDeniedException();
}
public function validateUpdate() {
parent::validateUpdate();
- foreach ($this->objects as $cronjob) {
+ foreach ($this->getObjects() as $cronjob) {
if (!$cronjob->isEditable()) {
throw new PermissionDeniedException();
}
public function validateToggle() {
parent::validateUpdate();
- foreach ($this->objects as $cronjob) {
+ foreach ($this->getObjects() as $cronjob) {
if (!$cronjob->canBeDisabled()) {
throw new PermissionDeniedException();
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $cronjob) {
+ foreach ($this->getObjects() as $cronjob) {
$cronjob->update([
'isDisabled' => $cronjob->isDisabled ? 0 : 1
]);
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;
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;
}
public function validateToggle() {
parent::validateUpdate();
- foreach ($this->objects as $language) {
+ foreach ($this->getObjects() as $language) {
if ($language->isDefault) {
throw new UserInputException('objectIDs');
}
* @inheritdoc
*/
public function toggle() {
- foreach ($this->objects as $language) {
+ foreach ($this->getObjects() as $language) {
$isDisabled = ($language->isDisabled) ? 0 : 1;
$language->update(['isDisabled' => $isDisabled]);
}
$this->readObjects();
}
- /** @var MediaEditor $mediaEditor */
- foreach ($this->objects as $mediaEditor) {
+ foreach ($this->getObjects() as $mediaEditor) {
$mediaEditor->deleteFiles();
}
*/
protected function unmarkItems(array $mediaIDs = []) {
if (empty($mediaIDs)) {
- foreach ($this->objects as $media) {
+ foreach ($this->getObjects() as $media) {
$mediaIDs[] = $media->mediaID;
}
}
public function validateDelete() {
parent::validateDelete();
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
if (!$object->canDelete()) {
throw new PermissionDeniedException();
}
public function validateToggle() {
parent::validateUpdate();
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
if (!$object->canDisable()) {
throw new PermissionDeniedException();
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
$object->update(['isDisabled' => ($object->isDisabled) ? 0 : 1]);
}
}
}
$queueIDs = [];
- foreach ($this->objects as $queue) {
+ foreach ($this->getObjects() as $queue) {
$queueIDs[] = $queue->queueID;
}
$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']);
}
$this->readObjects();
}
- foreach ($this->objects as $queue) {
+ foreach ($this->getObjects() as $queue) {
if (!$queue->canEdit()) {
throw new PermissionDeniedException();
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $notice) {
+ foreach ($this->getObjects() as $notice) {
$notice->update([
'isDisabled' => $notice->isDisabled ? 0 : 1
]);
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $server) {
+ foreach ($this->getObjects() as $server) {
$server->update(['isDisabled' => ($server->isDisabled) ? 0 : 1]);
}
}
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) {
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) {
public function validateDelete() {
parent::validateDelete();
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
if (!$object->canDelete()) {
throw new PermissionDeniedException();
}
public function validateToggle() {
parent::validateUpdate();
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
if (!$object->canDisable()) {
throw new PermissionDeniedException();
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
$object->update(['isDisabled' => ($object->isDisabled) ? 0 : 1]);
}
}
* @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);
- }
+ }
}
}
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
$object->update([
'isDisabled' => $object->isDisabled ? 0 : 1
]);
$this->readObjects();
}
- foreach ($this->objects as $subscriptionUser) {
+ foreach ($this->getObjects() as $subscriptionUser) {
$endDate = 0;
if (!isset($this->parameters['data']['endDate'])) {
$subscription = $subscriptionUser->getSubscription();
$this->readObjects();
}
- foreach ($this->objects as $subscriptionUser) {
+ foreach ($this->getObjects() as $subscriptionUser) {
$subscriptionUser->update(['isActive' => 0]);
// update group memberships
$this->readObjects();
}
- foreach ($this->objects as $subscriptionUser) {
+ foreach ($this->getObjects() as $subscriptionUser) {
if (!$subscriptionUser->isActive) {
throw new UserInputException('objectIDs');
}
$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();
$this->readObjects();
}
- foreach ($this->objects as $subscriptionUser) {
+ foreach ($this->getObjects() as $subscriptionUser) {
if ($subscriptionUser->isActive) {
throw new UserInputException('objectIDs');
}
$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) {
$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) {
public function update() {
parent::update();
- foreach ($this->objects as $style) {
+ foreach ($this->getObjects() as $style) {
// update variables
$this->updateVariables($style->getDecoratedObject(), true);
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);
public function validateToggle() {
parent::validateUpdate();
- foreach ($this->objects as $style) {
+ foreach ($this->getObjects() as $style) {
if ($style->isDefault) {
throw new UserInputException('objectIDs');
}
* @inheritdoc
*/
public function toggle() {
- foreach ($this->objects as $style) {
+ foreach ($this->getObjects() as $style) {
$isDisabled = ($style->isDisabled) ? 0 : 1;
$style->update(['isDisabled' => $isDisabled]);
}
]);
}
- foreach ($this->objects as $tagEditor) {
+ foreach ($this->getObjects() as $tagEditor) {
$this->tagEditor->addSynonym($tagEditor->getDecoratedObject());
}
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);
// delete avatars
$avatarIDs = [];
- foreach ($this->objects as $user) {
+ foreach ($this->getObjects() as $user) {
if ($user->avatarID) $avatarIDs[] = $user->avatarID;
}
if (!empty($avatarIDs)) {
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']);
$action->executeAction();
}
- foreach ($this->objects as $userEditor) {
+ foreach ($this->getObjects() as $userEditor) {
if (!empty($userOptions)) {
$userEditor->updateUserOptions($userOptions);
}
$groupIDs = $this->parameters['groups'];
- foreach ($this->objects as $userEditor) {
+ foreach ($this->getObjects() as $userEditor) {
$userEditor->removeFromGroups($groupIDs);
}
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);
}
// 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
]));
$disableSignatureExpires = 0;
}
- foreach ($this->objects as $userEditor) {
+ foreach ($this->getObjects() as $userEditor) {
$userEditor->update([
'disableSignature' => 1,
'disableSignatureReason' => $this->parameters['disableSignatureReason'],
$this->readObjects();
}
- foreach ($this->objects as $userEditor) {
+ foreach ($this->getObjects() as $userEditor) {
$userEditor->update([
'disableSignature' => 0
]);
$disableAvatarExpires = 0;
}
- foreach ($this->objects as $userEditor) {
+ foreach ($this->getObjects() as $userEditor) {
$userEditor->update([
'disableAvatar' => 1,
'disableAvatarReason' => $this->parameters['disableAvatarReason'],
$this->readObjects();
}
- foreach ($this->objects as $userEditor) {
+ foreach ($this->getObjects() as $userEditor) {
$userEditor->update([
'disableAvatar' => 0
]);
}
$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]);
}
$userToGroup = [];
- foreach ($this->objects as $user) {
+ foreach ($this->getObjects() as $user) {
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('groupID IN (?)', [$user->getGroupIDs()]);
$this->readObjects();
}
- foreach ($this->objects as $avatar) {
+ foreach ($this->getObjects() as $avatar) {
$adapter = ImageHandler::getInstance()->getAdapter();
$adapter->loadFile($avatar->getLocation());
}
// validate ownership
- foreach ($this->objects as $follow) {
+ foreach ($this->getObjects() as $follow) {
if ($follow->userID != WCF::getUser()->userID) {
throw new PermissionDeniedException();
}
$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]);
$this->readObjects();
}
- foreach ($this->objects as $object) {
+ foreach ($this->getObjects() as $object) {
$object->update($this->parameters['data']);
$object->updateGroupOptions($this->parameters['options']);
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $assignment) {
+ foreach ($this->getObjects() as $assignment) {
$assignment->update([
'isDisabled' => $assignment->isDisabled ? 0 : 1
]);
}
// validate ownership
- foreach ($this->objects as $ignore) {
+ foreach ($this->getObjects() as $ignore) {
if ($ignore->userID != WCF::getUser()->userID) {
throw new PermissionDeniedException();
}
public function validateDelete() {
parent::validateDelete();
- foreach ($this->objects as $userOption) {
+ foreach ($this->getObjects() as $userOption) {
if (!$userOption->canDelete()) {
throw new PermissionDeniedException();
}
* @inheritDoc
*/
public function toggle() {
- foreach ($this->objects as $optionEditor) {
+ foreach ($this->getObjects() as $optionEditor) {
$optionEditor->update([
'isDisabled' => 1 - $optionEditor->isDisabled
]);