Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
connection.php
1<?php
2
4
11
13{
15 private string $serviceName;
19 private ?int $id = null;
23 private ?string $name = null;
27 private ?Role $owner = null;
31 private ?VendorInterface $vendor = null;
35 private bool $deleted = false;
39 protected ?Date $lastSyncTime = null;
43 protected ?string $token = null;
47 protected string $status = '[200] Not synced';
55 protected ?Role $creator = null;
59 protected ?string $syncStatus = null;
63 protected ?Date $nextSyncTryTime = null;
64
68 public function getServer(): Server
69 {
70 return $this->getVendor()->getServer();
71 }
72
77 public function setServer(Server $server): Connection
78 {
79 $this->getVendor()->setServer($server);
80
81 return $this;
82 }
83
87 public function getOwner(): ?Role
88 {
89 return $this->owner;
90 }
91
95 public function getVendor(): VendorInterface
96 {
97 return $this->vendor;
98 }
99
103 public function getStatus(): string
104 {
105 return $this->status;
106 }
107
113 public function setStatus(?string $status): Connection
114 {
115 if ($status !== null)
116 {
117 $this->status = $status;
118 }
119
120 return $this;
121 }
122
126 public function getToken(): ?string
127 {
128 return $this->token;
129 }
130
136 public function setToken(?string $token): self
137 {
138 $this->token = $token;
139
140 return $this;
141 }
142
146 public function getLastSyncTime(): ?Date
147 {
148 return $this->lastSyncTime;
149 }
150
155 public function setLastSyncTime(?Date $time): self
156 {
157 $this->lastSyncTime = $time;
158
159 return $this;
160 }
161
165 public function getId(): ?int
166 {
167 return $this->id;
168 }
169
173 public function getName(): ?string
174 {
175 return $this->name;
176 }
177
181 public function isDeleted(): bool
182 {
183 return $this->deleted;
184 }
185
191 public function setDeleted(bool $deleted): self
192 {
193 $this->deleted = $deleted;
194
195 return $this;
196 }
197
203 public function setName(string $name): Connection
204 {
205 $this->name = $name;
206
207 return $this;
208 }
209
215 public function setVendor(VendorInterface $vendor): self
216 {
217 $this->vendor = $vendor;
218
219 return $this;
220 }
221
227 public function setOwner(?Role $owner): self
228 {
229 $this->owner = $owner;
230
231 return $this;
232 }
233
239 public function setId(int $id): self
240 {
241 $this->id = $id;
242
243 return $this;
244 }
245
251 public function setSectionCollection(SectionCollection $sectionCollection): self
252 {
253 $this->sectionCollection = $sectionCollection;
254
255 return $this;
256 }
257
262 {
263 // if ($this->sectionCollection === null)
264 // {
265 // // TODO: implement it
266 // $this->sectionCollection = Conn
267 // }
268 return $this->sectionCollection;
269 }
270
274 public function hasName(): bool
275 {
276 return $this->name && $this->name !== '';
277 }
278
282 public function getAccountType(): string
283 {
284 return $this->getVendor()->getCode();
285 }
286
291 public function setServiceName(string $name): self
292 {
293 $this->serviceName = $name;
294
295 return $this;
296 }
297
301 public function getServiceName(): string
302 {
303 return $this->serviceName;
304 }
305
306 public function setCreator(?Role $creator): self
307 {
308 $this->creator = $creator;
309
310 return $this;
311 }
312
316 public function getSyncStatus(): ?string
317 {
318 return $this->syncStatus;
319 }
320
326 public function setSyncStatus(?string $syncStatus): Connection
327 {
328 if ($syncStatus !== null)
329 {
330 $this->syncStatus = $syncStatus;
331 }
332
333 return $this;
334 }
335
339 public function getNextSyncTry(): ?Date
340 {
341 return $this->nextSyncTryTime;
342 }
343
349 public function setNextSyncTry(?Date $nextSyncTryTime): self
350 {
351 $this->nextSyncTryTime = $nextSyncTryTime;
352 return $this;
353 }
354}
setSectionCollection(SectionCollection $sectionCollection)