17 public const BOOL =
'bool';
22 public const DATE =
'date';
37 public const FILE =
'file';
42 public const INT =
'int';
62 public const TEXT =
'text';
67 public const USER =
'user';
72 public const TIME =
'time';
123 $this->
property = static::normalizeProperty(
$property);
143 return isset($this->property[
'Type']) ? $this->
property[
'Type'] :
null;
152 return $class::getType();
171 if (is_subclass_of(
$typeClass,
'\Bitrix\Bizproc\BaseType\Base'))
222 return !empty($this->property[
'Multiple']);
231 $this->
property[
'Multiple'] = (bool)$value;
240 return !empty($this->property[
'Required']);
248 return isset($this->property[
'Options']) ? $this->
property[
'Options'] :
null;
257 $this->
property[
'Options'] = $options;
268 return isset($this->property[
'Settings']) && is_array($this->property[
'Settings'])
269 ? $this->
property[
'Settings'] : array();
280 $this->
property[
'Settings'] = $settings;
289 return $this->
property[
'Name'];
297 return $this->
property[
'Description'];
311 return $typeClass::formatValueMultiple($this, $value, $format);
315 return $typeClass::formatValueSingle($this, $value, $format);
330 return $typeClass::convertValueMultiple($this, $value, $toTypeClass);
334 return $typeClass::convertValueSingle($this, $value, $toTypeClass);
346 $baseValue = (array) $baseValue;
348 if ($this->
isMultiple() && !\CBPHelper::isEmptyValue($appendValue))
350 return $typeClass::mergeValue($this, $baseValue, $appendValue);
363 return $typeClass::canRenderControl($renderMode);
373 public function renderControl(array $field, $value, $allowSelection, $renderMode)
379 return $typeClass::renderControlMultiple($this, $field, $value, $allowSelection, $renderMode);
383 return $typeClass::renderControlSingle($this, $field, $value, $allowSelection, $renderMode);
395 return $typeClass::renderControlOptions($this, $callbackFunctionName, $value);
404 public function extractValue(array $field, array $request, array &$errors =
null)
410 $result = $typeClass::extractValueMultiple($this, $field, $request);
414 $result = $typeClass::extractValueSingle($this, $field, $request);
416 $errors = $typeClass::getErrors();
431 $typeClass::clearValueMultiple($this, $value);
435 $typeClass::clearValueSingle($this, $value);
450 return $typeClass::internalizeValueMultiple($this, $context, $value);
454 return $typeClass::internalizeValueSingle($this, $context, $value);
469 return $typeClass::externalizeValueMultiple($this, $context, $value);
473 return $typeClass::externalizeValueSingle($this, $context, $value);
484 static::BOOL => BaseType\BoolType::class,
485 static::DATE => BaseType\Date::class,
486 static::DATETIME => BaseType\Datetime::class,
487 static::DOUBLE => BaseType\Double::class,
488 static::FILE => BaseType\File::class,
489 static::INT => BaseType\IntType::class,
490 static::SELECT => BaseType\Select::class,
491 static::STRING => BaseType\StringType::class,
492 static::TEXT => BaseType\Text::class,
493 static::USER => BaseType\User::class,
494 static::INTERNALSELECT => BaseType\InternalSelect::class,
495 static::TIME => BaseType\Time::class,
501 return array_key_exists($type, static::getBaseTypesMap());
531 case 'resourcebooking':
533 case 'iblock_section':
534 case 'iblock_element':
536 $bpType =
"UF:{$type}";
555 'Description' =>
null,
567 $normalized[
'Type'] = (string)
$property;
574 switch(mb_strtoupper($key))
578 $normalized[
'Type'] = (string)$val;
582 $normalized[
'Multiple'] = \CBPHelper::getBool($val);
586 $normalized[
'Required'] = \CBPHelper::getBool($val);
590 $normalized[
'Options'] = is_array($val)? $val : (string)$val;
593 $normalized[
'Settings'] = is_array($val) ? $val :
null;
596 $normalized[
'Id'] = (string)$val;
600 $normalized[
'Name'] = (string)$val;
603 $normalized[
'Description'] = (string)$val;
606 $normalized[
'Default'] = $val;
622 $this->
property[
'Default'] =
624 ? $typeClass::validateValueMultiple($value, $this)
625 : $typeClass::validateValueSingle($value, $this)
634 return $this->
property[
'Default'];
641 return $typeClass::convertPropertyToView($this, $viewMode, $this->
getProperty());
renderControl(array $field, $value, $allowSelection, $renderMode)
canRenderControl($renderMode)
const RENDER_MODE_DESIGNER
static convertUfType(string $type)
setDocumentType(array $documentType)
externalizeValue($context, $value)
setDocumentId(array $documentId)
extractValue(array $field, array $request, array &$errors=null)
const RENDER_MODE_JN_MOBILE
__construct(array $property, array $documentType, $typeClass, array $documentId=null)
internalizeValue($context, $value)
convertValue($value, $toTypeClass)
const VALUE_CONTEXT_DOCUMENT
setSettings(array $settings)
formatValue($value, $format='printable')
static normalizeProperty($property)
static isBaseType(string $type)
const VALUE_CONTEXT_JN_MOBILE
mergeValue($baseValue, $appendValue)
renderControlOptions($callbackFunctionName, $value)
convertPropertyToView(int $viewMode)