Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
order.php
1<?php
2namespace Bitrix\Seo\Adv;
3
9
41class OrderTable extends Entity\DataManager
42{
43 const PROCESSED = 'Y';
44 const NOT_PROCESSED = 'N';
45
51 public static function getTableName()
52 {
53 return 'b_seo_adv_order';
54 }
55
61 public static function getMap()
62 {
63 return array(
64 'ID' => array(
65 'data_type' => 'integer',
66 'primary' => true,
67 'autocomplete' => true,
68 ),
69 'ENGINE_ID' => array(
70 'data_type' => 'integer',
71 'required' => true,
72 ),
73 'TIMESTAMP_X' => array(
74 'data_type' => 'datetime',
75 'required' => true,
76 ),
77 'CAMPAIGN_ID' => array(
78 'data_type' => 'integer',
79 'required' => true,
80 ),
81 'BANNER_ID' => array(
82 'data_type' => 'integer',
83 'required' => true,
84 ),
85 'ORDER_ID' => array(
86 'data_type' => 'integer',
87 'required' => true,
88 ),
89 'SUM' => array(
90 'data_type' => 'float',
91 ),
92 'PROCESSED' => array(
93 'data_type' => 'boolean',
94 'values' => array(static::NOT_PROCESSED, static::PROCESSED),
95 ),
96 'CAMPAIGN' => array(
97 'data_type' => 'Bitrix\Seo\Adv\YandexCampaignTable',
98 'reference' => array('=this.CAMPAIGN_ID' => 'ref.ID'),
99 ),
100 'BANNER' => array(
101 'data_type' => 'Bitrix\Seo\Adv\YandexBannerTable',
102 'reference' => array('=this.BANNER_ID' => 'ref.ID'),
103 ),
104 'ORDER' => array(
105 'data_type' => 'Bitrix\Sale\OrderTable',
106 'reference' => array('=this.ORDER_ID' => 'ref.ID'),
107 )
108 );
109 }
110
111 public static function onBeforeAdd(Entity\Event $event)
112 {
113 $result = new Entity\EventResult();
114 $result->modifyFields(array("TIMESTAMP_X" => new DateTime()));
115 return $result;
116 }
117}
static onBeforeAdd(Entity\Event $event)
Definition order.php:111