34 $value = current(\CBPHelper::makeArrayFlat($value));
44 return (
string)current(\CBPHelper::makeArrayFlat($value));
47 return parent::externalizeValue($fieldType, $context, $value);
59 $type = $toTypeClass::getType();
63 $value = mb_strtolower((
string)$value);
64 $value = in_array($value, [
'y',
'yes',
'true',
'1']) ?
'Y' :
'N';
68 $value = (string)$value;
70 if (Bizproc\BaseType\Value\DateTime::isSerialized($value))
78 if (\CheckDateTime($value, $format))
81 Main\
Type\Date::convertFormatToPhp($format),
82 \CBPHelper::makeTimestamp($value, $format)
87 $value = date(Main\
Type\Date::convertFormatToPhp($format), strtotime($value));
92 $value = str_replace(
' ',
'', str_replace(
',',
'.', $value));
93 $value = (float)$value;
96 $value = str_replace(
' ',
'', $value);
101 $value = (string)$value;
104 $value = trim($value);
106 mb_strpos($value,
'user_') ===
false
107 && mb_strpos($value,
'group_') ===
false
108 && !preg_match(
'#^[0-9]+$#', $value)
154 return static::renderControlSelector($field, $value,
'combine',
'', $fieldType);
157 return parent::renderControl($fieldType, $field, $value, $allowSelection, $renderMode);
179 $value = static::toSingleValue($fieldType, $value);
181 return static::renderControl($fieldType, $field, $value, $allowSelection, $renderMode);
200 if (!is_array($value) || is_array($value) && \CBPHelper::isAssociativeArray($value))
212 foreach ($value as $k => $v)
214 $singleField = $field;
215 $singleField[
'Index'] = $k;
216 $controls[] = static::renderControl(
227 $renderResult = static::renderPublicMultipleWrapper($fieldType, $field, $controls);
231 $renderResult = static::wrapCloneableControls($controls, static::generateControlName($field));
234 return $renderResult;
239 if (\CBPHelper::isEmptyValue($baseValue))
241 return (array)$appendValue;
244 if (!is_array($appendValue))
246 $baseValue[] = $appendValue;
251 if (!\CBPHelper::isAssociativeArray($baseValue) && !\CBPHelper::isAssociativeArray($appendValue))
253 return array_values(array_merge($baseValue, $appendValue));
256 return $baseValue + $appendValue;
static convertTo(FieldType $fieldType, $value, $toTypeClass)
static renderControl(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode)
static externalizeValue(FieldType $fieldType, $context, $value)
static renderControlSingle(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode)
static toSingleValue(FieldType $fieldType, $value)
static renderControlMultiple(FieldType $fieldType, array $field, $value, $allowSelection, $renderMode)
static getConversionMap()
static mergeValue(FieldType $fieldType, array $baseValue, $appendValue)
static canRenderControl($renderMode)