ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilUserDefinedFieldsPlaceholderValues Class Reference
+ Inheritance diagram for ilUserDefinedFieldsPlaceholderValues:
+ Collaboration diagram for ilUserDefinedFieldsPlaceholderValues:

Public Member Functions

 __construct (private readonly Language $lng, private readonly ilCertificateObjectHelper $objectHelper, private readonly Profile $user_profile, private readonly ilCertificateUtilHelper $ilUtilHelper)
 
 getPlaceholderValuesForPreview (int $userId, int $objId)
 This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate. More...
 
- Public Member Functions inherited from ilCertificatePlaceholderValues
 getPlaceholderValues (int $userId, int $objId)
 This method MUST return an array that contains the actual data for the given user of the given object. More...
 
 getPlaceholderValuesForPreview (int $userId, int $objId)
 This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilUserDefinedFieldsPlaceholderValues::__construct ( private readonly Language  $lng,
private readonly ilCertificateObjectHelper  $objectHelper,
private readonly Profile  $user_profile,
private readonly ilCertificateUtilHelper  $ilUtilHelper 
)

Definition at line 30 of file class.ilUserDefinedFieldsPlaceholderValues.php.

35 {
36 }

Member Function Documentation

◆ getPlaceholderValuesForPreview()

ilUserDefinedFieldsPlaceholderValues::getPlaceholderValuesForPreview ( int  $userId,
int  $objId 
)

This method is different then the 'getPlaceholderValues' method, this method is used to create a placeholder value array containing dummy values that is used to create a preview certificate.

Implements ilCertificatePlaceholderValues.

Definition at line 73 of file class.ilUserDefinedFieldsPlaceholderValues.php.

73 : array
74 {
75 $userDefinedFields = $this->user_profile->getDefinitions();
76
77 $placeholder = [];
78 foreach ($userDefinedFields as $field) {
79 if ($field['certificate']) {
80 $placeholderText = '#' . str_replace(' ', '_', ilStr::strToUpper($field['field_name']));
81
82 $placeholder[$placeholderText] = $field['field_name'];
83 }
84 }
85
86 return $placeholder;
87 }
static strToUpper(string $a_string)
Definition: class.ilStr.php:78

References ilStr\strToUpper().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: