| 1 | <?php |
||
| 7 | class UserIdentifier implements ApiParameters |
||
| 8 | { |
||
| 9 | /** @var int */ |
||
| 10 | private $id; |
||
| 11 | |||
| 12 | /** @var string */ |
||
| 13 | private $screenName; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * UserIdentifier constructor. |
||
| 17 | * |
||
| 18 | * @param int $id |
||
| 19 | * @param string $screenName |
||
| 20 | */ |
||
| 21 | 51 | private function __construct($id, $screenName) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * @return int |
||
| 30 | */ |
||
| 31 | public function getId() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return string |
||
| 38 | */ |
||
| 39 | public function getScreenName() |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param int $id |
||
| 46 | * |
||
| 47 | * @return UserIdentifier |
||
| 48 | */ |
||
| 49 | 48 | public static function fromId($id) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @param string $screenName |
||
| 56 | * |
||
| 57 | * @return UserIdentifier |
||
| 58 | */ |
||
| 59 | 6 | public static function fromScreenName($screenName) |
|
| 63 | |||
| 64 | /** |
||
| 65 | * @return array |
||
| 66 | */ |
||
| 67 | 12 | public function toArray() |
|
| 79 | } |
||
| 80 |