Skip to content

Commit

Permalink
API Remove deprecated API (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 9, 2025
1 parent 083e4c2 commit 62f3a86
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions src/Model/Subsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,12 @@ public static function getSubsiteIDForDomain($host = null, $checkPermissions = t
* @param class-string<T> $className
* @param string $filter
* @param string $sort
* @param string $join Deprecated, use leftJoin($table, $joinClause) instead
* @param string $limit
* @return DataList<T>
*/
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;
}
Expand Down Expand Up @@ -919,31 +918,6 @@ public function activate()
Subsite::changeSubsite($this);
}

/**
* @param array $permissionCodes
* @return DataList<Member>
* @deprecated 3.4.0 Will be removed without equivalent functionality
*/
public function getMembersByPermission($permissionCodes = ['ADMIN'])
{
Deprecation::noticeWithNoReplacment('3.4.0');
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
*/
Expand Down

0 comments on commit 62f3a86

Please sign in to comment.