1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ufield.php
См. документацию.
1<?php
8
10
12
19class UField extends Field
20{
21 protected
26
27 public function __construct(array $info)
28 {
30
31 $user_type = $USER_FIELD_MANAGER->getUserType($info['USER_TYPE_ID']);
32
33 $this->base_type = $user_type['BASE_TYPE'];
34
35 if (in_array($this->base_type, array('int', 'enum', 'file'), true))
36 {
37 $data_type = 'integer';
38 }
39 elseif ($this->base_type == 'double')
40 {
41 $data_type = 'float';
42 }
43 elseif ($this->base_type == 'string')
44 {
45 $data_type = 'string';
46 }
47 elseif (in_array($this->base_type, array('date', 'datetime'), true))
48 {
49 $data_type = 'datetime';
50 }
51 else
52 {
53 $data_type = 'string';
54 }
55
56 parent::__construct($info['FIELD_NAME'], $info);
57
58 $this->dataType = $data_type;
59
60 $this->is_multiple = $info['MULTIPLE'] === 'Y';
61 $this->type_id = $info['USER_TYPE_ID'];
62 $this->field_id = $info['ID'];
63 }
64
65 public function getTypeMask()
66 {
68 }
69
70 public function validateValue($value, $primary, $row, Result $result)
71 {
72 return true;
73 }
74
75 public function getTypeId()
76 {
77 return $this->type_id;
78 }
79
80 public function isMultiple()
81 {
82 return $this->is_multiple;
83 }
84
85 public function getBaseType()
86 {
87 return $this->base_type;
88 }
89
90 public function getFieldId()
91 {
92 return $this->field_id;
93 }
94
95 public function getValueFieldName()
96 {
97 if ($this->isMultiple())
98 {
99 $utm_fname = 'VALUE';
100
101 if ($this->getDataType() == 'integer')
102 {
103 $utm_fname .= '_INT';
104 }
105 elseif ($this->getDataType() == 'float')
106 {
107 $utm_fname .= '_DOUBLE';
108 }
109 elseif ($this->getDataType() == 'datetime')
110 {
111 $utm_fname .= '_DATE';
112 }
113
114 return $utm_fname;
115 }
116 else
117 {
118 return $this->getName();
119 }
120 }
121
122 //public static function getDataTypeByBaseType($baseType)
123 public static function convertBaseTypeToDataType($baseType)
124 {
125 if (in_array($baseType, array('int', 'enum', 'file'), true))
126 {
127 $data_type = 'integer';
128 }
129 elseif ($baseType == 'double')
130 {
131 $data_type = 'float';
132 }
133 elseif ($baseType == 'string')
134 {
135 $data_type = 'string';
136 }
137 elseif (in_array($baseType, array('date', 'datetime'), true))
138 {
139 $data_type = 'datetime';
140 }
141 else
142 {
143 $data_type = 'string';
144 }
145
146 return $data_type;
147 }
148
149 public function getColumnName()
150 {
151 return $this->name;
152 }
153}
154
155
$base_type
Определения ufield.php:24
getValueFieldName()
Определения ufield.php:95
__construct(array $info)
Определения ufield.php:27
$field_id
Определения ufield.php:25
validateValue($value, $primary, $row, Result $result)
Определения ufield.php:70
getFieldId()
Определения ufield.php:90
$is_multiple
Определения ufield.php:22
static convertBaseTypeToDataType($baseType)
Определения ufield.php:123
getTypeMask()
Определения ufield.php:65
getBaseType()
Определения ufield.php:85
isMultiple()
Определения ufield.php:80
getColumnName()
Определения ufield.php:149
getTypeId()
Определения ufield.php:75
getDataType()
Определения field.php:569
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $USER_FIELD_MANAGER
Определения attempt.php:6
$result
Определения get_property_values.php:14
if($NS['step']==6) if( $NS[ 'step']==7) if(COption::GetOptionInt('main', 'disk_space', 0) > 0) $info
Определения backup.php:924
Определения ufield.php:9
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393