1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Contains FeedsAccountSwitcherInterface interface.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Defines an interface for a service for safe account switching.
|
10
|
*/
|
11
|
interface FeedsAccountSwitcherInterface {
|
12
|
|
13
|
/**
|
14
|
* Safely switches to another account.
|
15
|
*
|
16
|
* Each invocation of FeedsAccountSwitcherInterface::switchTo() must be
|
17
|
* matched by a corresponding invocation of
|
18
|
* FeedsAccountSwitcherInterface::switchBack() in the same function.
|
19
|
*
|
20
|
* @param object $account
|
21
|
* The account to switch to.
|
22
|
*
|
23
|
* @return FeedsAccountSwitcherInterface
|
24
|
* $this.
|
25
|
*/
|
26
|
public function switchTo($account);
|
27
|
|
28
|
/**
|
29
|
* Reverts to a previous account after switching.
|
30
|
*
|
31
|
* @return FeedsAccountSwitcherInterface
|
32
|
* $this.
|
33
|
*
|
34
|
* @throws FeedsAccountSwitcherException
|
35
|
* When there are no more account switches to revert.
|
36
|
*/
|
37
|
public function switchBack();
|
38
|
|
39
|
}
|