ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Services\User\InterestedUserFieldAttribute Class Reference

Class InterestedUserFieldAttribute. More...

+ Collaboration diagram for ILIAS\Services\User\InterestedUserFieldAttribute:

Public Member Functions

 __construct (string $attributeName, string $fieldName)
 
 getName ()
 
 getAttributeName ()
 
 getComponents ()
 
 addComponent (string $componentName, string $description)
 

Static Public Attributes

static ilLanguage $lng = null
 

Private Member Functions

 getNameTranslation (string $fieldName, string $attributeName)
 

Private Attributes

string $attributeName
 
string $name
 
array $components = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Services\User\InterestedUserFieldAttribute::__construct ( string  $attributeName,
string  $fieldName 
)

Definition at line 40 of file InterestedUserFieldAttribute.php.

References ILIAS\Services\User\InterestedUserFieldAttribute\$attributeName, $DIC, $lng, and ILIAS\Services\User\InterestedUserFieldAttribute\getNameTranslation().

41  {
42  $this->attributeName = $attributeName;
43  if (!self::$lng) {
44  global $DIC;
45  self::$lng = $DIC->language();
46  }
47  $this->name = $this->getNameTranslation($fieldName, $attributeName);
48  }
$lng
getNameTranslation(string $fieldName, string $attributeName)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ addComponent()

ILIAS\Services\User\InterestedUserFieldAttribute::addComponent ( string  $componentName,
string  $description 
)

Definition at line 78 of file InterestedUserFieldAttribute.php.

78  : InterestedUserFieldComponent
79  {
80  foreach ($this->components as $component) {
81  if ($component->getComponentName() === $componentName) {
82  return $component;
83  }
84  }
85 
86  $component = new InterestedUserFieldComponent(
87  $componentName,
88  $description
89  );
90  $this->components[] = $component;
91 
92  return $component;
93  }

◆ getAttributeName()

ILIAS\Services\User\InterestedUserFieldAttribute::getAttributeName ( )

◆ getComponents()

ILIAS\Services\User\InterestedUserFieldAttribute::getComponents ( )

◆ getName()

ILIAS\Services\User\InterestedUserFieldAttribute::getName ( )

◆ getNameTranslation()

ILIAS\Services\User\InterestedUserFieldAttribute::getNameTranslation ( string  $fieldName,
string  $attributeName 
)
private

Definition at line 68 of file InterestedUserFieldAttribute.php.

References $lng, and ilObjUserFolderGUI\USER_FIELD_TRANSLATION_MAPPING.

Referenced by ILIAS\Services\User\InterestedUserFieldAttribute\__construct().

68  : string
69  {
70  $translationKey = str_replace("_$fieldName", "", $attributeName);
71  if (isset(ilObjUserFolderGUI::USER_FIELD_TRANSLATION_MAPPING[$translationKey])) {
73  }
74 
75  return "INVALID TRANSLATION KEY";
76  }
$lng
+ Here is the caller graph for this function:

Field Documentation

◆ $attributeName

string ILIAS\Services\User\InterestedUserFieldAttribute::$attributeName
private

◆ $components

array ILIAS\Services\User\InterestedUserFieldAttribute::$components = []
private

◆ $lng

ilLanguage ILIAS\Services\User\InterestedUserFieldAttribute::$lng = null
static

Definition at line 32 of file InterestedUserFieldAttribute.php.

◆ $name

string ILIAS\Services\User\InterestedUserFieldAttribute::$name
private

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