From 828c1747f68f67235f4046bbc44ba4a09ede0d0b Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 12 Nov 2024 14:32:38 -0100 Subject: [PATCH] squash to previous --- code/web/sys/Community/Campaign.php | 10 +++++----- code/web/sys/Community/CampaignAccess.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/web/sys/Community/Campaign.php b/code/web/sys/Community/Campaign.php index cec85c22b5..2db2c687ab 100644 --- a/code/web/sys/Community/Campaign.php +++ b/code/web/sys/Community/Campaign.php @@ -3,7 +3,7 @@ require_once ROOT_DIR . '/sys/Community/CampaignMilestone.php'; require_once ROOT_DIR . '/sys/Community/UserCampaign.php'; require_once ROOT_DIR . '/sys/Community/Reward.php'; -require_once ROOT_DIR . '/sys/Community/CampaignAccess.php'; +require_once ROOT_DIR . '/sys/Community/CampaignPatronTypeAccess.php'; require_once ROOT_DIR . '/sys/Account/User.php'; @@ -105,7 +105,7 @@ public static function getObjectStructure($context = ''): array { public function getPatronTypeAccess() { if (!isset($this->_allowPatronTypeAccess) && $this->id) { $this->_allowPatronTypeAccess = []; - $patronTypeLink = new CampaignAccess(); + $patronTypeLink = new CampaignPatronTypeAccess(); $patronTypeLink->campaignId = $this->id; $patronTypeLink->find(); while ($patronTypeLink->fetch()) { @@ -120,7 +120,7 @@ public function savePatronTypeAccess() { $this->clearPatronTypeAccess(); foreach ($this->_allowPatronTypeAccess as $patronTypeId) { - $link = new CampaignAccess(); + $link = new CampaignPatronTypeAccess(); $link->campaignId = $this->id; $link->patronTypeId = $patronTypeId; $link->insert(); @@ -131,7 +131,7 @@ public function savePatronTypeAccess() { private function clearPatronTypeAccess() { //Delete links to the patron types - $link = new CampaignAccess(); + $link = new CampaignPatronTypeAccess(); $link->campaignId = $this->id; return $link->delete(true); } @@ -296,7 +296,7 @@ public function find($fetchFirst = false, $requireOneMatchToReturn = true): bool if (!UserAccount::isLoggedIn() || UserAccount::getActiveUserObj()->isAspenAdminUser()) return parent::find($fetchFirst, $requireOneMatchToReturn); - $this->joinAdd(new CampaignAccess(), 'INNER', 'ce_campaign_patron_type_access', 'id', 'campaignId'); + $this->joinAdd(new CampaignPatronTypeAccess(), 'INNER', 'ce_campaign_patron_type_access', 'id', 'campaignId'); $this->whereAdd("ce_campaign_patron_type_access.patronTypeId = '" . UserAccount::getActiveUserObj()->getPTypeObj()->id . "'"); return parent::find($fetchFirst, $requireOneMatchToReturn); } diff --git a/code/web/sys/Community/CampaignAccess.php b/code/web/sys/Community/CampaignAccess.php index ae096edb74..20759e47fe 100644 --- a/code/web/sys/Community/CampaignAccess.php +++ b/code/web/sys/Community/CampaignAccess.php @@ -1,7 +1,7 @@