Bitrix-D7
20.5.0
seo/lib/adv/order.php
См. документацию.
1
<?php
2
namespace
Bitrix\Seo\Adv
;
3
4
use
Bitrix\Main\Application
;
5
use
Bitrix\Main\Entity
;
6
use
Bitrix\Main\Type\DateTime
;
7
use
Bitrix\Main\Web\HttpClient
;
8
use
Bitrix\Seo\Engine
;
9
10
/**
11
* Class OrderTable
12
*
13
* Fields:
14
* <ul>
15
* <li> ID int mandatory
16
* <li> ENGINE_ID int mandatory
17
* <li> TIMESTAMP_X datetime mandatory default 'CURRENT_TIMESTAMP'
18
* <li> REQUEST_URI string(100) mandatory
19
* <li> REQUEST_DATA string optional
20
* <li> RESPONSE_TIME double mandatory
21
* <li> RESPONSE_STATUS int optional
22
* <li> RESPONSE_DATA string optional
23
* </ul>
24
*
25
* @package Bitrix\Seo
26
**/
27
28
class
OrderTable
extends
Entity\DataManager
29
{
30
const
PROCESSED
=
'Y'
;
31
const
NOT_PROCESSED
=
'N'
;
32
33
/**
34
* Returns DB table name for entity.
35
*
36
* @return string
37
*/
38
public
static
function
getTableName
()
39
{
40
return
'b_seo_adv_order'
;
41
}
42
43
/**
44
* Returns entity map definition.
45
*
46
* @return array
47
*/
48
public
static
function
getMap
()
49
{
50
return
array(
51
'ID'
=> array(
52
'data_type'
=>
'integer'
,
53
'primary'
=>
true
,
54
'autocomplete'
=>
true
,
55
),
56
'ENGINE_ID'
=> array(
57
'data_type'
=>
'integer'
,
58
'required'
=>
true
,
59
),
60
'TIMESTAMP_X'
=> array(
61
'data_type'
=>
'datetime'
,
62
'required'
=>
true
,
63
),
64
'CAMPAIGN_ID'
=> array(
65
'data_type'
=>
'integer'
,
66
'required'
=>
true
,
67
),
68
'BANNER_ID'
=> array(
69
'data_type'
=>
'integer'
,
70
'required'
=>
true
,
71
),
72
'ORDER_ID'
=> array(
73
'data_type'
=>
'integer'
,
74
'required'
=>
true
,
75
),
76
'SUM'
=> array(
77
'data_type'
=>
'float'
,
78
),
79
'PROCESSED'
=> array(
80
'data_type'
=>
'boolean'
,
81
'values'
=> array(static::NOT_PROCESSED, static::PROCESSED),
82
),
83
'CAMPAIGN'
=> array(
84
'data_type'
=>
'Bitrix\Seo\Adv\YandexCampaignTable'
,
85
'reference'
=> array(
'=this.CAMPAIGN_ID'
=>
'ref.ID'
),
86
),
87
'BANNER'
=> array(
88
'data_type'
=>
'Bitrix\Seo\Adv\YandexBannerTable'
,
89
'reference'
=> array(
'=this.BANNER_ID'
=>
'ref.ID'
),
90
),
91
'ORDER'
=> array(
92
'data_type'
=>
'Bitrix\Sale\OrderTable'
,
93
'reference'
=> array(
'=this.ORDER_ID'
=>
'ref.ID'
),
94
)
95
);
96
}
97
98
public
static
function
onBeforeAdd
(
Entity
\
Event
$event)
99
{
100
$result =
new
Entity\EventResult();
101
$result->modifyFields(array(
"TIMESTAMP_X"
=>
new
DateTime
()));
102
return
$result;
103
}
104
}
Bitrix\Main\Application
Base class for any application.
Definition:
main/lib/application.php:26
Bitrix\Main\Event
Definition:
main/lib/event.php:5
Bitrix\Main\ORM\Entity
Base entity.
Definition:
main/lib/orm/entity.php:26
Bitrix\Main\Type\DateTime
Definition:
main/lib/type/datetime.php:8
Bitrix\Main\Web\HttpClient
Definition:
httpclient.php:15
Bitrix\Seo\Adv\OrderTable
Definition:
seo/lib/adv/order.php:29
Bitrix\Seo\Adv\OrderTable\PROCESSED
const PROCESSED
Definition:
seo/lib/adv/order.php:30
Bitrix\Seo\Adv\OrderTable\getMap
static getMap()
Returns entity map definition.
Definition:
seo/lib/adv/order.php:48
Bitrix\Seo\Adv\OrderTable\NOT_PROCESSED
const NOT_PROCESSED
Definition:
seo/lib/adv/order.php:31
Bitrix\Seo\Adv\OrderTable\onBeforeAdd
static onBeforeAdd(Entity\Event $event)
Definition:
seo/lib/adv/order.php:98
Bitrix\Seo\Adv\OrderTable\getTableName
static getTableName()
Returns DB table name for entity.
Definition:
seo/lib/adv/order.php:38
Bitrix\Seo\Adv
Definition:
auto.php:2
Bitrix\Seo\Engine
Definition:
bitrix.php:9
modules
seo
lib
adv
order.php
Создано системой
1.9.1