1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
urlrewrite.php
См. документацию.
1<?php
2namespace Bitrix\Landing\Internals;
3
4use \Bitrix\Main\Localization\Loc;
5use \Bitrix\Main\Entity;
6use \Bitrix\Landing\Manager;
7
8Loc::loadMessages(__FILE__);
9
26class UrlRewriteTable extends Entity\DataManager
27{
32 public static function getTableName()
33 {
34 return 'b_landing_urlrewrite';
35 }
36
41 public static function getMap()
42 {
43 return array(
44 'ID' => new Entity\IntegerField('ID', array(
45 'primary' => true,
46 'autocomplete' => true,
47 'title' => 'ID'
48 )),
49 'SITE_ID' => new Entity\IntegerField('SITE_ID', array(
50 'title' => Loc::getMessage('LANDING_TABLE_FIELD_SITE_ID'),
51 'required' => true
52 )),
53 'RULE' => new Entity\StringField('RULE', array(
54 'title' => Loc::getMessage('LANDING_TABLE_FIELD_RULE'),
55 'required' => true
56 )),
57 'LANDING_ID' => new Entity\IntegerField('LANDING_ID', array(
58 'title' => Loc::getMessage('LANDING_TABLE_FIELD_LANDING_ID'),
59 'required' => true
60 )),
61 'CREATED_BY_ID' => new Entity\IntegerField('CREATED_BY_ID', array(
62 'title' => Loc::getMessage('LANDING_TABLE_FIELD_CREATED_BY_ID'),
63 'required' => true
64 )),
65 'MODIFIED_BY_ID' => new Entity\IntegerField('MODIFIED_BY_ID', array(
66 'title' => Loc::getMessage('LANDING_TABLE_FIELD_MODIFIED_BY_ID'),
67 'required' => true
68 )),
69 'DATE_CREATE' => new Entity\DatetimeField('DATE_CREATE', array(
70 'title' => Loc::getMessage('LANDING_TABLE_FIELD_DATE_CREATE'),
71 'required' => true
72 )),
73 'DATE_MODIFY' => new Entity\DatetimeField('DATE_MODIFY', array(
74 'title' => Loc::getMessage('LANDING_TABLE_FIELD_DATE_MODIFY'),
75 'required' => true
76 ))
77 );
78 }
79
85 public static function add(array $fields)
86 {
88 $uid = $uid ? $uid : 1;
89 $date = new \Bitrix\Main\Type\DateTime;
90
91 if (!isset($fields['CREATED_BY_ID']))
92 {
93 $fields['CREATED_BY_ID'] = $uid;
94 }
95 if (!isset($fields['MODIFIED_BY_ID']))
96 {
97 $fields['MODIFIED_BY_ID'] = $uid;
98 }
99 if (!isset($fields['DATE_CREATE']))
100 {
101 $fields['DATE_CREATE'] = $date;
102 }
103 if (!isset($fields['DATE_MODIFY']))
104 {
105 $fields['DATE_MODIFY'] = $date;
106 }
107
108 return parent::add($fields);
109 }
110
117 public static function update($id, array $fields = array())
118 {
120 $date = new \Bitrix\Main\Type\DateTime;
121
122 if (!isset($fields['MODIFIED_BY_ID']))
123 {
124 $fields['MODIFIED_BY_ID'] = $uid;
125 }
126 if (!isset($fields['DATE_MODIFY']))
127 {
128 $fields['DATE_MODIFY'] = $date;
129 }
130 if (!$fields['DATE_MODIFY'])
131 {
132 unset($fields['DATE_MODIFY']);
133 }
134
135 return parent::update($id, $fields);
136 }
137}
static update($id, array $fields=array())
Определения urlrewrite.php:117
static add(array $fields)
Определения urlrewrite.php:85
static getUserId()
Определения manager.php:107
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$uid
Определения hot_keys_act.php:8
Определения ufield.php:9
$fields
Определения yandex_run.php:501