Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
Job.php
1
<?php
2
3
namespace
Bitrix\Seo\Sitemap\Internals
;
4
5
use \Bitrix\Main\Entity;
6
use \Bitrix\Main\Localization\Loc;
7
use
Bitrix\Main\Type\DateTime
;
8
use
Bitrix\Seo\Sitemap\Job
;
9
10
Loc::loadMessages
(__FILE__);
11
12
class
JobTable
extends
Entity\DataManager
13
{
14
15
public
static
function
getTableName
()
16
{
17
return
'b_seo_sitemap_job'
;
18
}
19
20
public
static
function
getMap
()
21
{
22
return
[
23
'ID'
=>
new
Entity\IntegerField(
'ID'
, [
24
'primary'
=>
true
,
25
'autocomplete'
=>
true
,
26
'title'
=>
'ID'
,
27
]),
28
'SITEMAP_ID'
=>
new
Entity\IntegerField(
'SITEMAP_ID'
, [
29
'required'
=>
true
,
30
'title'
=>
'Sitemap ID'
,
31
]),
32
'RUNNING'
=>
new
Entity\BooleanField(
'RUNNING'
, [
33
'required'
=>
true
,
34
'title'
=>
'If job is running now'
,
35
'values'
=> [
'Y'
,
'N'
],
36
]),
37
'STATUS'
=>
new
Entity\StringField(
'STATUS'
, [
38
'required'
=>
true
,
39
'default_value'
=>
Job::STATUS_REGISTER
,
40
'title'
=>
'Status of job'
,
41
]),
42
'STATUS_MESSAGE'
=>
new
Entity\StringField(
'STATUS_MESSAGE'
, [
43
'title'
=>
'Text message of status current job'
,
44
]),
45
'STEP'
=>
new
Entity\IntegerField(
'STEP'
, [
46
'required'
=>
true
,
47
'default_value'
=> 0,
48
'title'
=>
'Current step'
,
49
]),
50
'STATE'
=>
new
Entity\StringField(
'STATE'
, [
51
'serialized'
=>
true
,
52
'title'
=>
'Process state data'
,
53
]),
54
'DATE_MODIFY'
=>
new
Entity\DatetimeField(
'DATE_MODIFY'
, [
55
'title'
=>
'Date of changes'
,
56
]),
57
];
58
}
59
60
public
static
function
onBeforeAdd
(
Entity
\
Event
$event)
61
{
62
return
self::prepareChanges
($event);
63
}
64
70
public
static
function
onBeforeUpdate
(
Entity
\
Event
$event)
71
{
72
return
self::prepareChanges
($event);
73
}
74
75
protected
static
function
prepareChanges
(
Entity
\
Event
$event):
Entity
\
EventResult
76
{
77
$result =
new
Entity\EventResult();
78
$result->modifyFields([
79
'DATE_MODIFY'
=> (
new
DateTime
()),
80
]);
81
82
return
$result;
83
}
84
}
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\EventResult
Definition
eventresult.php:5
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Seo\Sitemap\Internals\JobTable
Definition
Job.php:13
Bitrix\Seo\Sitemap\Internals\JobTable\onBeforeUpdate
static onBeforeUpdate(Entity\Event $event)
Definition
Job.php:70
Bitrix\Seo\Sitemap\Internals\JobTable\getMap
static getMap()
Definition
Job.php:20
Bitrix\Seo\Sitemap\Internals\JobTable\onBeforeAdd
static onBeforeAdd(Entity\Event $event)
Definition
Job.php:60
Bitrix\Seo\Sitemap\Internals\JobTable\prepareChanges
static prepareChanges(Entity\Event $event)
Definition
Job.php:75
Bitrix\Seo\Sitemap\Internals\JobTable\getTableName
static getTableName()
Definition
Job.php:15
Bitrix\Seo\Sitemap\Job
Definition
Job.php:20
Bitrix\Seo\Sitemap\Job\STATUS_REGISTER
const STATUS_REGISTER
Definition
Job.php:35
Bitrix\Seo\Sitemap\Internals
Definition
Entity.php:3
modules
seo
lib
Sitemap
Internals
Job.php
Создано системой
1.10.0