SilverStripe\Subsites\State\SubsiteState::withState
Perform a given action within the context of a new, isolated state. Modifications are temporary and the existing state will be restored afterwards.
Signature
public function withState(callable
$callback )
Parameters
$callback
— callable- Callback to run. Will be passed the nested state as a parameter
Returns
- mixed
- Result of callback