Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
UserPerPhone.php
1<?php
2
4
6
7class UserPerPhone extends Base
8{
10
11 public function getEntityId(): string
12 {
13 return 'upp_' . $this->getEntity();
14 }
15
16 public function isCanSend(): bool
17 {
18 if ($this->getCurrentAdditionalParam() === '0')
19 {
20 return true;
21 }
22
23 return parent::isCanSend();
24 }
25
26 public function increase(): bool
27 {
28 if ($this->getCurrentAdditionalParam() === '0')
29 {
30 return true;
31 }
32
33 return parent::increase();
34 }
35
36
37 protected function getOptionLimitName(): string
38 {
39 return 'network_restriction_user_per_phone';
40 }
41
42 protected function getEntity(): string
43 {
44 return $this->message->getTo();
45 }
46
47 protected function getCurrentAdditionalParam(): string
48 {
49 return (string)($this->message->getAuthorId() ?: CurrentUser::get()->getId());
50 }
51
52 protected function getDefaultLimit(): int
53 {
54 return 0;
55 }
56}