Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
fuser.php
1<?php
9
10use Bitrix\Main;
12
13Loc::loadMessages(__FILE__);
14
31class FuserTable extends Main\Entity\DataManager
32{
38 public static function getTableName()
39 {
40 return 'b_sale_fuser';
41 }
42
48 public static function getMap()
49 {
50 global $DB;
51
52 return array(
53 'ID' => array(
54 'data_type' => 'integer',
55 'primary' => true,
56 'autocomplete' => true,
57 ),
58 'DATE_INSERT' => array(
59 'data_type' => 'datetime'
60 ),
61 'DATE_INS' => array(
62 'data_type' => 'datetime',
63 'expression' => array(
64 $DB->DatetimeToDateFunction('%s'), 'DATE_INSERT'
65 )
66 ),
67 'DATE_UPDATE' => array(
68 'data_type' => 'datetime'
69 ),
70 'DATE_UPD' => array(
71 'data_type' => 'datetime',
72 'expression' => array(
73 $DB->DatetimeToDateFunction('%s'), 'DATE_UPDATE'
74 )
75 ),
76 new Main\Entity\IntegerField(
77 "USER_ID"
78 ),
79
80 'USER' => array(
81 'data_type' => 'Bitrix\Main\User',
82 'reference' => array('=this.USER_ID' => 'ref.ID')
83 ),
84
85 new Main\Entity\StringField(
86 'CODE',
87 array(
88 'size' => 32
89 )),
90 );
91 }
92
100 public static function getUserById($id)
101 {
102 $id = (int)$id;
103 if ($id <= 0)
104 return false;
105 $fuserIterator = self::getList(array(
106 'select' => array('USER_ID'),
107 'filter' => array('=ID' => $id)
108 ));
109 if ($fuser = $fuserIterator->fetch())
110 return (int)$fuser['USER_ID'];
111 return false;
112 }
113}
static loadMessages($file)
Definition loc.php:64