continue implementations

This commit is contained in:
Dennis Eichhorn 2024-01-12 00:30:03 +00:00
parent b66a28e782
commit 8fae14a103
5 changed files with 9 additions and 4 deletions

View File

@ -35,6 +35,11 @@
"type": "TINYINT(1)",
"null": false
},
"attribute_attr_type_repeatable": {
"name": "attribute_attr_type_repeatable",
"type": "TINYINT(1)",
"null": false
},
"attribute_attr_type_required": {
"description": "Every element must have this attribute type if set to true.",
"name": "attribute_attr_type_required",

View File

@ -154,6 +154,7 @@ trait ApiAttributeTraitController
$attrType = new AttributeType($request->getDataString('name') ?? '');
$attrType->datatype = $request->getDataInt('datatype') ?? 0;
$attrType->custom = $request->getDataBool('custom') ?? false;
$attrType->repeatable = $request->getDataBool('repeatable') ?? false;
$attrType->isRequired = $request->getDataBool('is_required') ?? false;
$attrType->validationPattern = $request->getDataString('validation_pattern') ?? '';
$attrType->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);

View File

@ -63,6 +63,8 @@ class AttributeType implements \JsonSerializable
public bool $isRequired = false;
public bool $repeatable = false;
/**
* Datatype of the attribute
*

View File

@ -58,6 +58,7 @@ final class AttributeValueMapper extends DataMapperFactory
'mapper' => AttributeValueL11nMapper::class,
'table' => 'attribute_attr_value_l11n',
'self' => 'attribute_attr_value_l11n_value',
'column' => 'content',
'external' => null,
],
];

View File

@ -13,16 +13,12 @@
declare(strict_types=1);
use phpOMS\Localization\ISO639Enum;
use phpOMS\Localization\NullLocalization;
use phpOMS\Uri\UriFactory;
$attribute = $this->attributes;
$languages = ISO639Enum::getConstants();
$types = $this->attributeTypes;
$units = $this->units;
/** @var \phpOMS\Localization\Localization $l11n */
$l11n = $this->data['defaultlocalization'] ?? new NullLocalization();
?>
<div class="col-xs-12 col-md-6">