19declare(strict_types=1);
48 public function normalize($value): array|float|bool|
int|string|null
50 if (!($value instanceof \
ilObject)) {
57 'obj_id' => $this->tt->normalize(
new Id($value->getId(),
'object')),
58 'title' => $value->getTitle(),
59 'description' => $value->getLongDescription(),
60 'type' => $value->getType(),
61 'owner' => $value->getOwner(),
62 'create_date' => $value->getCreateDate(),
63 'last_update' => $value->getLastUpdateDate(),
64 'import_id' => $value->getImportId(),
86 'title' => $property->getTitle(),
87 'description' => $property->getDescription(),
88 'long_description' => $property->getLongDescription(),
92 if ($property instanceof
Online) {
93 return $property->getIsOnline();
101 return $property->getVisibility();
112 'languages' => array_map(fn(
Language $language): array => [
123 if ($type !== \ilObject::class && !in_array(\ilObject::class, class_parents($type))) {
128 $object_type = $this->tt->string($value[
'type']);
130 if ($object_class !== $type) {
131 throw new NormalizingException(
"Expected {$type}, got object of type {$object_type} ({$object_class})");
135 $object =
new $object_class(0,
false);
137 $object->setId($this->tt->denormalize($value[
'obj_id'], Id::class)->getId());
138 $object->setTitle($this->tt->string($value[
'title']));
139 $object->setDescription($this->tt->string($value[
'description']));
140 $object->setType($this->tt->string($value[
'type']));
141 $object->setOwner($this->tt->int($value[
'owner']));
142 $object->setImportId($this->tt->string($value[
'import_id']));
getPropertyTitleAndIconVisibility()
getPropertyInfoTabVisibility()
getPropertyTranslations()
getPropertyTitleAndDescription()
getPropertyHeaderActionVisibility()
Class handles translation mode for an object.
Wrapper object for an object identifier and an optional object type the identifier belongs to.
denormalize(array|float|bool|int|string|null $value, string $type)
Converts a normalized form back into a value.
normalize($value)
Converts a value into a normalized form.
normalizeProperties(Properties $properties)
normalizeTranslations(Translations $translations)
__construct(protected readonly Transformations $tt,)
normalizeProperty(Property $property)
Exception thrown when a value cannot be normalized or denormalized.
static getClassByType(string $obj_type)
Class ilObject Basic functions for all objects.
A Normalizer is responsible for converting a value into a normalized form and back.