1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
abstractentity.php
См. документацию.
1<?php
2
4
6
7abstract class AbstractEntity
8{
9 protected $entityId;
10 protected $initiatorId;
12 protected $call;
13
14 public function __construct(Call $call, $entityId)
15 {
16 $this->call = $call;
17 $this->entityId = $entityId;
18 $this->initiatorId = $call->getInitiatorId();
19 }
20
21 public function getEntityId($currentUserId = 0)
22 {
23 return $this->entityId;
24 }
25
29 public function getCall()
30 {
31 return $this->call;
32 }
33
37 public function setCall(Call $call)
38 {
39 $this->call = $call;
40 }
41
42 abstract public function getEntityType();
43
44 abstract public function canStartCall(int $userId): bool;
45
46 abstract public function checkAccess(int $userId): bool;
47
48 abstract public function getChatId();
49
50 abstract public function getUsers();
51
52 abstract public function getName($currentUserId);
53
54 // todo: remove when the calls are supported in the mobile
55 abstract public function onCallCreate(): bool;
56
57 abstract public function onUserAdd($userId): bool;
58
59 abstract public function onExistingUsersInvite($userIds): bool;
60
61 abstract public function onStateChange($state, $prevState);
62
63 public function toArray($initiatorId = 0)
64 {
65 if($initiatorId == 0)
66 {
68 }
69 return [
70 'type' => $this->getEntityType(),
71 'id' => $this->getEntityId($initiatorId),
72 'name' => $this->getName($initiatorId)
73 ];
74 }
75}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
Определения call.php:24
__construct(Call $call, $entityId)
Определения abstractentity.php:14
getEntityId($currentUserId=0)
Определения abstractentity.php:21
Определения auth.php:9