ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjectCustomUserFieldsPlaceholderValues Class Reference
+ Inheritance diagram for ilObjectCustomUserFieldsPlaceholderValues:
+ Collaboration diagram for ilObjectCustomUserFieldsPlaceholderValues:

Public Member Functions

 __construct (ilCertificateObjectHelper $objectHelper=null, ilCertificateUtilHelper $ilUtilHelper=null)
 
 getPlaceholderValuesForPreview (int $user_id, int $obj_id)
 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

 $placeholder
 
 $objectHelper
 
 $ilUtilHelper
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjectCustomUserFieldsPlaceholderValues::__construct ( ilCertificateObjectHelper  $objectHelper = null,
ilCertificateUtilHelper  $ilUtilHelper = null 
)
Parameters
ilCertificateObjectHelper | null$objectHelper
ilCertificateUtilHelper | null$ilUtilHelper

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

References $ilUtilHelper, $objectHelper, $placeholder, ilCourseDefinedFieldDefinition\_getFields(), ilCourseUserData\_getValuesByObjId(), ilCertificatePlaceholderValues\getPlaceholderValues(), and ilStr\strToUpper().

31  {
32  $this->placeholder = array();
33 
34  if (null === $objectHelper) {
35  $objectHelper = new ilCertificateObjectHelper();
36  }
37  $this->objectHelper = $objectHelper;
38 
39  if (null === $ilUtilHelper) {
40  $ilUtilHelper = new ilCertificateUtilHelper();
41  }
42  $this->ilUtilHelper = $ilUtilHelper;
43  }
Just a wrapper class to create Unit Test for other classes.
+ Here is the call graph for this function:

Member Function Documentation

◆ getPlaceholderValuesForPreview()

ilObjectCustomUserFieldsPlaceholderValues::getPlaceholderValuesForPreview ( int  $user_id,
int  $obj_id 
)

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.

Parameters
int$user_id
int$obj_id
Returns
array - [PLACEHOLDER] => 'dummy value'
Exceptions
ilException
ilInvalidCertificateException

Implements ilCertificatePlaceholderValues.

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

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

93  : array
94  {
95  global $DIC;
96 
97  $lng = $DIC->language();
98 
99  $course_defined_fields = ilCourseDefinedFieldDefinition::_getFields($obj_id);
100 
101  $placeholder = array();
102  foreach ($course_defined_fields as $key => $field) {
103  $placeholderText = '+' . str_replace(' ', '_', ilStr::strToUpper($field->getName()));
104 
105  $placeholder[$placeholderText] = $placeholderText . '_' . ilStr::strToUpper($lng->txt('value'));
106  }
107 
108  return $placeholder;
109  }
$lng
global $DIC
Definition: goto.php:24
static strToUpper($a_string)
Definition: class.ilStr.php:96
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
+ Here is the call graph for this function:

Field Documentation

◆ $ilUtilHelper

ilObjectCustomUserFieldsPlaceholderValues::$ilUtilHelper
private

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

Referenced by __construct().

◆ $objectHelper

ilObjectCustomUserFieldsPlaceholderValues::$objectHelper
private

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

Referenced by __construct().

◆ $placeholder

ilObjectCustomUserFieldsPlaceholderValues::$placeholder
private

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