19declare(strict_types=1);
33 private readonly
Profile $user_profile,
50 $user = $this->objectHelper->getInstanceByObjId($userId);
52 throw new ilException(
'The entered id: ' . $userId .
' is not an user object');
55 $userDefinedFields = $this->user_profile->getVisibleUserDefinedFields(Context::Certificate);
58 foreach ($userDefinedFields as $field) {
59 $placeholderText =
'#' . str_replace(
' ',
'_',
ilStr::strToUpper($field->getLabel($this->lng)));
60 $placeholder[$placeholderText] = $this->ilUtilHelper->prepareFormOutput(
61 $field->retrieveValueFromUser($user)
75 $userDefinedFields = $this->user_profile->getDefinitions();
78 foreach ($userDefinedFields as $field) {
79 if ($field[
'certificate']) {
80 $placeholderText =
'#' . str_replace(
' ',
'_',
ilStr::strToUpper($field[
'field_name']));
82 $placeholder[$placeholderText] = $field[
'field_name'];
Just a wrapper class to create Unit Test for other classes.
Base class for ILIAS Exception handling.
static strToUpper(string $a_string)
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...
__construct(private readonly Language $lng, private readonly ilCertificateObjectHelper $objectHelper, private readonly Profile $user_profile, private readonly ilCertificateUtilHelper $ilUtilHelper)
getPlaceholderValues(int $userId, int $objId)
This method MUST return an array that contains the actual data for the given user of the given object...