Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ReminderPopupItem.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Link\Reminder
;
4
5
use
Bitrix\Im\V2\Rest\PopupDataItem
;
6
7
class
ReminderPopupItem
implements
PopupDataItem
8
{
9
// todo refactor this. replace with lazy load
10
private
ReminderCollection
$reminders;
11
12
public
function
__construct
($reminders =
null
)
13
{
14
if
(!$reminders instanceof
ReminderCollection
)
15
{
16
$this->reminders =
new
ReminderCollection
();
17
}
18
else
19
{
20
$this->reminders = $reminders;
21
}
22
23
if
($reminders instanceof
ReminderItem
)
24
{
25
if
($this->reminders[$reminders->getId()] ===
null
)
26
{
27
$this->reminders->
add
($reminders);
28
}
29
}
30
}
31
32
public
function
merge
(
PopupDataItem
$item): self
33
{
34
if
($item instanceof
self
)
35
{
36
foreach
($item->reminders as $reminder)
37
{
38
if
(!isset($this->reminders[$reminder->getId()]))
39
{
40
$this->reminders->add($reminder);
41
}
42
}
43
}
44
45
return
$this;
46
}
47
48
public
static
function
getRestEntityName
(): string
49
{
50
return
'reminders'
;
51
}
52
53
public
function
toRestFormat
(array $option = []): array
54
{
55
$option[
'WITHOUT_MESSAGES'
] =
'Y'
;
56
return
$this->reminders->toRestFormat($option);
57
}
58
}
Bitrix\Im\V2\Collection\add
add(ActiveRecord $entry)
Definition
Collection.php:60
Bitrix\Im\V2\Link\Reminder\ReminderCollection
Definition
ReminderCollection.php:26
Bitrix\Im\V2\Link\Reminder\ReminderItem
Definition
ReminderItem.php:20
Bitrix\Im\V2\Link\Reminder\ReminderPopupItem
Definition
ReminderPopupItem.php:8
Bitrix\Im\V2\Link\Reminder\ReminderPopupItem\getRestEntityName
static getRestEntityName()
Definition
ReminderPopupItem.php:48
Bitrix\Im\V2\Link\Reminder\ReminderPopupItem\toRestFormat
toRestFormat(array $option=[])
Definition
ReminderPopupItem.php:53
Bitrix\Im\V2\Link\Reminder\ReminderPopupItem\__construct
__construct($reminders=null)
Definition
ReminderPopupItem.php:12
Bitrix\Im\V2\Link\Reminder\ReminderPopupItem\merge
merge(PopupDataItem $item)
Definition
ReminderPopupItem.php:32
Bitrix\Im\V2\Rest\PopupDataItem
Definition
PopupDataItem.php:6
Bitrix\Im\V2\Link\Reminder
Definition
ReminderCollection.php:3
modules
im
lib
V2
Link
Reminder
ReminderPopupItem.php
Создано системой
1.10.0