Skip to content

Commit

Permalink
Merge pull request silverstripe#504 from creative-commoners/pulls/2/depr
Browse files Browse the repository at this point in the history
API Deprecate passing multiple IDs
  • Loading branch information
GuySartorelli authored Jan 26, 2023
2 parents 6770ded + 30b1f09 commit 7d8909a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/State/SubsiteState.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Core\Resettable;
use SilverStripe\Dev\Deprecation;

/**
* SubsiteState provides static access to the current state for subsite related data during a request
Expand Down Expand Up @@ -48,6 +49,9 @@ public function getSubsiteId()
*/
public function setSubsiteId($id)
{
if (!ctype_digit((string) $id) && !is_null($id)) {
Deprecation::notice('2.8.0', 'Passing multiple IDs is deprecated, only pass a single ID instead.');
}
if (is_null($this->originalSubsiteId)) {
$this->originalSubsiteId = (int) $id;
}
Expand Down

0 comments on commit 7d8909a

Please sign in to comment.