Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
context.php
1<?php
2
11
12class Context implements \JsonSerializable
13{
14 protected $userId;
15 protected $applicationId;
17 protected $storedAuthId;
18 protected $storedAuthHash;
19 protected $hitAuthId;
20
21 public function __construct()
22 {
23 }
24
28 public function getUserId(): int
29 {
30 return (int)$this->userId;
31 }
32
37 public function setUserId(?int $userId): Context
38 {
39 $this->userId = $userId;
40 return $this;
41 }
42
46 public function getApplicationId(): ?string
47 {
48 return $this->applicationId;
49 }
50
55 public function setApplicationId(?string $applicationId): Context
56 {
57 $this->applicationId = $applicationId;
58 return $this;
59 }
60
64 public function getApplicationPasswordId(): ?int
65 {
66 return $this->applicationPasswordId;
67 }
68
73 public function setApplicationPasswordId(?int $applicationPasswordId): Context
74 {
75 $this->applicationPasswordId = $applicationPasswordId;
76 return $this;
77 }
78
82 public function getStoredAuthId(): ?int
83 {
84 return $this->storedAuthId;
85 }
86
91 public function setStoredAuthId(?int $storedAuthId): Context
92 {
93 $this->storedAuthId = $storedAuthId;
94 return $this;
95 }
96
100 public function getHitAuthId(): ?int
101 {
102 return $this->hitAuthId;
103 }
104
109 public function setHitAuthId(?int $hitAuthId): Context
110 {
111 $this->hitAuthId = $hitAuthId;
112 return $this;
113 }
114
118 public function getStoredAuthHash()
119 {
120 return $this->storedAuthHash;
121 }
122
127 public function setStoredAuthHash(?string $storedAuthHash)
128 {
129 $this->storedAuthHash = $storedAuthHash;
130 return $this;
131 }
132
133 public function jsonSerialize(): array
134 {
135 $data = [];
136
137 foreach ($this as $property => $dummy)
138 {
139 $data[$property] = $this->{$property};
140 }
141
142 return $data;
143 }
144
149 public static function jsonDecode(string $json): Context
150 {
151 $obj = new static();
152
153 if ($json != '')
154 {
155 $data = json_decode($json, true);
156
157 foreach ($obj as $property => $dummy)
158 {
159 if (isset($data[$property]))
160 {
161 $obj->{$property} = $data[$property];
162 }
163 }
164 }
165
166 return $obj;
167 }
168}
setApplicationId(?string $applicationId)
Definition context.php:55
setStoredAuthId(?int $storedAuthId)
Definition context.php:91
setApplicationPasswordId(?int $applicationPasswordId)
Definition context.php:73
setStoredAuthHash(?string $storedAuthHash)
Definition context.php:127
static jsonDecode(string $json)
Definition context.php:149