ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectCustomUserFieldsPlaceholderValues Class Reference
+ Inheritance diagram for ilObjectCustomUserFieldsPlaceholderValues:
+ Collaboration diagram for ilObjectCustomUserFieldsPlaceholderValues:

Public Member Functions

 __construct (?ilCertificateObjectHelper $objectHelper=null, ?ilCertificateUtilHelper $utilHelper=null)
 
 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...
 

Private Attributes

readonly ilCertificateObjectHelper $objectHelper
 
readonly ilCertificateUtilHelper $utilHelper
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjectCustomUserFieldsPlaceholderValues::__construct ( ?ilCertificateObjectHelper  $objectHelper = null,
?ilCertificateUtilHelper  $utilHelper = null 
)

Definition at line 29 of file class.ilObjectCustomUserFieldsPlaceholderValues.php.

References $objectHelper, $objId, $utilHelper, ilCourseDefinedFieldDefinition\_getFields(), ilCourseUserData\_getValuesByObjId(), ilCertificatePlaceholderValues\getPlaceholderValues(), null, and ilStr\strToUpper().

32  {
33  if (null === $objectHelper) {
35  }
36  $this->objectHelper = $objectHelper;
37  if (null === $utilHelper) {
39  }
40  $this->utilHelper = $utilHelper;
41  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Member Function Documentation

◆ getPlaceholderValuesForPreview()

ilObjectCustomUserFieldsPlaceholderValues::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 82 of file class.ilObjectCustomUserFieldsPlaceholderValues.php.

References $DIC, $lng, ilCourseDefinedFieldDefinition\_getFields(), and ilStr\strToUpper().

82  : array
83  {
84  global $DIC;
85 
86  $lng = $DIC->language();
87 
88  $course_defined_fields = ilCourseDefinedFieldDefinition::_getFields($objId);
89 
90  $placeholder = [];
91  foreach ($course_defined_fields as $field) {
92  $placeholderText = '+' . str_replace(' ', '_', ilStr::strToUpper($field->getName()));
93 
94  $placeholder[$placeholderText] = $placeholderText . '_' . ilStr::strToUpper($lng->txt('value'));
95  }
96 
97  return $placeholder;
98  }
$objId
Definition: xapitoken.php:57
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
static strToUpper(string $a_string)
Definition: class.ilStr.php:81
global $DIC
Definition: shib_login.php:22
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $objectHelper

readonly ilCertificateObjectHelper ilObjectCustomUserFieldsPlaceholderValues::$objectHelper
private

Definition at line 26 of file class.ilObjectCustomUserFieldsPlaceholderValues.php.

Referenced by __construct().

◆ $utilHelper

readonly ilCertificateUtilHelper ilObjectCustomUserFieldsPlaceholderValues::$utilHelper
private

Definition at line 27 of file class.ilObjectCustomUserFieldsPlaceholderValues.php.

Referenced by __construct().


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