Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
template.php
1
<?php
8
namespace
Bitrix\Sender\Entity
;
9
10
use
Bitrix\Main\Localization\Loc
;
11
use
Bitrix\Sender\TemplateTable
;
12
use Bitrix\Tasks\Exception;
13
14
Loc::loadMessages
(__FILE__);
15
16
class
Template
extends
Base
17
{
23
protected
function
getDefaultData
()
24
{
25
return
array(
26
'NAME'
=>
''
,
27
'CONTENT'
=>
''
,
28
);
29
}
30
37
protected
function
loadData
($id)
38
{
39
return
TemplateTable::getRowById
($id);
40
}
41
49
protected
function
saveData
($id, array $data)
50
{
51
return
$this->saveByEntity(
TemplateTable::getEntity
(), $id, $data);
52
}
53
59
public
function
remove
()
60
{
61
return
$this->removeByEntity(
TemplateTable::getEntity
(), $this->
getId
());
62
}
63
69
public
function
copy
()
70
{
71
$data = [
72
'ACTIVE'
=> $this->data[
'ACTIVE'
],
73
'NAME'
=> $this->data[
'NAME'
],
74
'CONTENT'
=> $this->data[
'CONTENT'
],
75
];
76
$instance = static::create()->mergeData($data);
77
return
$instance->save();
78
}
79
80
87
public
static
function
removeById
($id)
88
{
89
return
static::create()->removeByEntity(
TemplateTable::getEntity
(), $id);
90
}
91
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\ORM\Data\DataManager\getEntity
static getEntity()
Definition
datamanager.php:78
Bitrix\Main\ORM\Data\DataManager\getRowById
static getRowById($id)
Definition
datamanager.php:392
Bitrix\Sender\Connector\Base
Definition
base.php:13
Bitrix\Sender\Connector\Base\getId
getId()
Definition
base.php:206
Bitrix\Sender\Entity\Template
Definition
template.php:17
Bitrix\Sender\Entity\Template\loadData
loadData($id)
Definition
template.php:37
Bitrix\Sender\Entity\Template\getDefaultData
getDefaultData()
Definition
template.php:23
Bitrix\Sender\Entity\Template\removeById
static removeById($id)
Definition
template.php:87
Bitrix\Sender\Entity\Template\copy
copy()
Definition
template.php:69
Bitrix\Sender\Entity\Template\saveData
saveData($id, array $data)
Definition
template.php:49
Bitrix\Sender\TemplateTable
Definition
template.php:37
Bitrix\Sender\Entity
Definition
ad.php:8
modules
sender
lib
entity
template.php
Создано системой
1.10.0