mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
API Deprecate passing multiple IDs
This commit is contained in:
parent
6770dedc2a
commit
30b1f09af4
@ -5,6 +5,7 @@ namespace SilverStripe\Subsites\State;
|
||||
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
|
||||
@ -48,6 +49,9 @@ class SubsiteState implements Resettable
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user