From 2e347a4392bcbb30fa800c2bbffb4e1c7f709c9d Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 8 Jan 2025 12:13:08 +1300 Subject: [PATCH] API Remove deprecated param from SubSite::get_from_all_subsites() --- src/Model/Subsite.php | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/Model/Subsite.php b/src/Model/Subsite.php index f840df2b..677c8cd7 100644 --- a/src/Model/Subsite.php +++ b/src/Model/Subsite.php @@ -313,13 +313,12 @@ public static function getSubsiteIDForDomain($host = null, $checkPermissions = t * @param class-string $className * @param string $filter * @param string $sort - * @param string $join * @param string $limit * @return DataList */ - public static function get_from_all_subsites($className, $filter = '', $sort = '', $join = '', $limit = '') + public static function get_from_all_subsites($className, $filter = '', $sort = '', $limit = '') { - $result = DataObject::get($className, $filter, $sort, $join, $limit); + $result = DataObject::get($className, $filter, $sort, $limit); $result = $result->setDataQueryParam('Subsite.filter', false); return $result; } @@ -919,29 +918,6 @@ public function activate() Subsite::changeSubsite($this); } - /** - * @param array $permissionCodes - * @return DataList - */ - public function getMembersByPermission($permissionCodes = ['ADMIN']) - { - if (!is_array($permissionCodes)) { - user_error('Permissions must be passed to Subsite::getMembersByPermission as an array', E_USER_ERROR); - } - $SQL_permissionCodes = Convert::raw2sql($permissionCodes); - - $SQL_permissionCodes = join("','", $SQL_permissionCodes); - - return DataObject::get( - Member::class, - "\"Group\".\"SubsiteID\" = $this->ID AND \"Permission\".\"Code\" IN ('$SQL_permissionCodes')", - '', - 'LEFT JOIN "Group_Members" ON "Member"."ID" = "Group_Members"."MemberID" - LEFT JOIN "Group" ON "Group"."ID" = "Group_Members"."GroupID" - LEFT JOIN "Permission" ON "Permission"."GroupID" = "Group"."ID"' - ); - } - /** * Duplicate this subsite */