ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\Test\Logging\TestError Class Reference
+ Inheritance diagram for ILIAS\Test\Logging\TestError:
+ Collaboration diagram for ILIAS\Test\Logging\TestError:

Public Member Functions

 __construct (private readonly int $test_ref_id, private readonly ?int $question_id, private readonly ?int $admin_id, private readonly ?int $pax_id, private readonly TestErrorTypes $interaction_type, private readonly int $modification_timestamp, private readonly string $error_message)
 
 getUniqueIdentifier ()
 
 withId (int $id)
 
 getLogEntryAsDataTableRow (\ilLanguage $lng, TitleColumnsBuilder $title_builder, DataRowBuilder $row_builder, array $environment)
 
 getLogEntryAsExportRow (\ilLanguage $lng, TitleColumnsBuilder $title_builder, AdditionalInformationGenerator $additional_info, array $environment)
 
 getParsedAdditionalInformation (AdditionalInformationGenerator $additional_info, UIFactory $ui_factory, array $environment)
 
 toStorage ()
 

Data Fields

const IDENTIFIER = 'te'
 
- Data Fields inherited from ILIAS\Test\Logging\TestUserInteraction
const LANG_VAR_PREFIX = 'logs_'
 

Private Member Functions

 getUserForPresentation (?int $user_id)
 

Private Attributes

int $id
 

Detailed Description

Definition at line 30 of file TestError.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Logging\TestError::__construct ( private readonly int  $test_ref_id,
private readonly ?int  $question_id,
private readonly ?int  $admin_id,
private readonly ?int  $pax_id,
private readonly TestErrorTypes  $interaction_type,
private readonly int  $modification_timestamp,
private readonly string  $error_message 
)

Definition at line 36 of file TestError.php.

44  {
45 
46  }

Member Function Documentation

◆ getLogEntryAsDataTableRow()

ILIAS\Test\Logging\TestError::getLogEntryAsDataTableRow ( \ilLanguage  $lng,
TitleColumnsBuilder  $title_builder,
DataRowBuilder  $row_builder,
array  $environment 
)

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 60 of file TestError.php.

References ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow(), ILIAS\Test\Utilities\TitleColumnsBuilder\buildQuestionTitleAsLink(), ILIAS\Test\Utilities\TitleColumnsBuilder\buildTestTitleAsLink(), ILIAS\Test\Logging\TestError\getUniqueIdentifier(), ILIAS\Test\Logging\TestError\getUserForPresentation(), and ilLanguage\txt().

65  : DataRow {
66  $admin = $this->getUserForPresentation($this->admin_id);
67  $pax = $this->getUserForPresentation($this->pax_id);
68 
69  $values = [
70  'date_and_time' => \DateTimeImmutable::createFromFormat('U', (string) $this->modification_timestamp)
71  ->setTimezone($environment['timezone']),
72  'corresponding_test' => $title_builder->buildTestTitleAsLink(
73  $this->test_ref_id
74  ),
75  'admin' => $admin,
76  'participant' => $pax,
77  'log_entry_type' => $lng->txt(self::LANG_VAR_PREFIX . self::IDENTIFIER),
78  'interaction_type' => $lng->txt(self::LANG_VAR_PREFIX . $this->interaction_type->value)
79  ];
80 
81  if ($this->question_id !== null) {
82  $values['question'] = $title_builder->buildQuestionTitleAsLink(
83  $this->question_id,
84  $this->test_ref_id
85  );
86  }
87 
88  return $row_builder->buildDataRow(
89  $this->getUniqueIdentifier(),
90  $values
91  );
92  }
getUserForPresentation(?int $user_id)
Definition: TestError.php:139
global $lng
Definition: privfeed.php:32
+ Here is the call graph for this function:

◆ getLogEntryAsExportRow()

ILIAS\Test\Logging\TestError::getLogEntryAsExportRow ( \ilLanguage  $lng,
TitleColumnsBuilder  $title_builder,
AdditionalInformationGenerator  $additional_info,
array  $environment 
)

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 94 of file TestError.php.

References ILIAS\Test\Utilities\TitleColumnsBuilder\buildQuestionTitleAsText(), ILIAS\Test\Utilities\TitleColumnsBuilder\buildTestTitleAsText(), ILIAS\Test\Logging\TestError\getUserForPresentation(), and ilLanguage\txt().

99  : array {
100  $admin = $this->getUserForPresentation($this->admin_id);
101  $pax = $this->getUserForPresentation($this->pax_id);
102 
103  return [
104  \DateTimeImmutable::createFromFormat('U', (string) $this->modification_timestamp)
105  ->setTimezone($environment['timezone'])
106  ->format($environment['date_format']),
107  $title_builder->buildTestTitleAsText($this->test_ref_id),
108  $admin,
109  $pax,
110  '',
111  $title_builder->buildQuestionTitleAsText($this->question_id),
112  $lng->txt(self::LANG_VAR_PREFIX . self::IDENTIFIER),
113  $lng->txt(self::LANG_VAR_PREFIX . $this->interaction_type->value),
114  $this->error_message
115  ];
116  }
getUserForPresentation(?int $user_id)
Definition: TestError.php:139
global $lng
Definition: privfeed.php:32
+ Here is the call graph for this function:

◆ getParsedAdditionalInformation()

ILIAS\Test\Logging\TestError::getParsedAdditionalInformation ( AdditionalInformationGenerator  $additional_info,
UIFactory  $ui_factory,
array  $environment 
)

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 118 of file TestError.php.

122  : Legacy {
123  return $ui_factory->legacy($this->error_message);
124  }

◆ getUniqueIdentifier()

ILIAS\Test\Logging\TestError::getUniqueIdentifier ( )

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 48 of file TestError.php.

References ILIAS\Test\Logging\TestError\$id.

Referenced by ILIAS\Test\Logging\TestError\getLogEntryAsDataTableRow().

48  : ?string
49  {
50  return self::IDENTIFIER . '_' . $this->id;
51  }
+ Here is the caller graph for this function:

◆ getUserForPresentation()

ILIAS\Test\Logging\TestError::getUserForPresentation ( ?int  $user_id)
private

Definition at line 139 of file TestError.php.

Referenced by ILIAS\Test\Logging\TestError\getLogEntryAsDataTableRow(), and ILIAS\Test\Logging\TestError\getLogEntryAsExportRow().

139  : string
140  {
141  if ($user_id === null) {
142  return '';
143  }
144  return \ilUserUtil::getNamePresentation(
145  $user_id,
146  false,
147  false,
148  '',
149  true
150  );
151  }
+ Here is the caller graph for this function:

◆ toStorage()

ILIAS\Test\Logging\TestError::toStorage ( )

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 126 of file TestError.php.

References ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by ILIAS\Test\Logging\TestLoggingDatabaseRepository\storeError().

126  : array
127  {
128  return [
129  'ref_id' => [\ilDBConstants::T_INTEGER , $this->test_ref_id],
130  'qst_id' => [\ilDBConstants::T_INTEGER , $this->question_id],
131  'admin_id' => [\ilDBConstants::T_INTEGER , $this->admin_id],
132  'pax_id' => [\ilDBConstants::T_INTEGER , $this->pax_id],
133  'interaction_type' => [\ilDBConstants::T_TEXT , $this->interaction_type->value],
134  'modification_ts' => [\ilDBConstants::T_INTEGER , $this->modification_timestamp],
135  'error_message' => [\ilDBConstants::T_TEXT , $this->error_message]
136  ];
137  }
+ Here is the caller graph for this function:

◆ withId()

ILIAS\Test\Logging\TestError::withId ( int  $id)

Implements ILIAS\Test\Logging\TestUserInteraction.

Definition at line 53 of file TestError.php.

References ILIAS\Test\Logging\TestError\$id.

53  : self
54  {
55  $clone = clone $this;
56  $clone->id = $id;
57  return $clone;
58  }

Field Documentation

◆ $id

int ILIAS\Test\Logging\TestError::$id
private

◆ IDENTIFIER


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