19declare(strict_types=1);
24use ILIAS\User\Profile\Fields\NoOverrides;
38 private readonly
Uuid $identifier,
39 private ?
Type $type =
null,
40 private string $label =
'',
42 private ?
string $additional_edit_form_data =
null
48 return $this->type ===
null;
53 return $this->identifier->toString();
64 $clone->label = $label;
70 return $this->type?->getLabel(
$lng) ??
'';
82 return $this->section;
88 $clone->section = $section;
101 $this->additional_edit_form_data
107 $clone = clone $this;
108 $clone->additional_edit_form_data =
$data;
125 $this->additional_edit_form_data
129 $this->section->value
139 $value = $user === null
141 : $user->getProfileData()->getAdditionalFieldByIdentifier($this->getIdentifier()) ?? [];
142 return $this->type->getLegacyInput(
147 $this->additional_edit_form_data
156 return $user->withProfileData(
157 $user->getProfileData()->withAdditionalFieldByIdentifier(
158 $this->getIdentifier(),
159 $this->type->prepareUserInputForStorage($input)
166 return $this->type->buildPresentationValueFromUserValue(
167 $user->
getProfileData()->getAdditionalFieldByIdentifier($this->getIdentifier()) ?? [],
168 $this->additional_edit_form_data
withSection(AvailableSections $section)
getAdditionalEditFormInputs(Language $lng, FieldFactory $ff, Refinery $refinery)
addValueToUserObject(\ilObjUser $user, mixed $input, \ilPropertyFormGUI $form)
withAdditionalEditFormData(?string $data)
retrieveValueFromUser(\ilObjUser $user)
getLegacyInput(Language $lng, Context $context, ?\ilObjUser $user=null)
You don't need to add a post_var to the input as the User will handle this for you,...
getTypeLabel(Language $lng)
__construct(private readonly Uuid $identifier, private ?Type $type=null, private string $label='', private ?AvailableSections $section=null, private ?string $additional_edit_form_data=null)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...