ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Questions\Persistence\TableNameBuilder Class Reference
+ Inheritance diagram for ILIAS\Questions\Persistence\TableNameBuilder:
+ Collaboration diagram for ILIAS\Questions\Persistence\TableNameBuilder:

Public Member Functions

 __construct (private readonly string $component_name_space, private readonly ?TableSubNameSpace $table_sub_name_space)
 
 getTableNameFor (TableTypes $table, string $specifier='')
 

Detailed Description

Definition at line 23 of file TableNameBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Questions\Persistence\TableNameBuilder::__construct ( private readonly string  $component_name_space,
private readonly ?TableSubNameSpace  $table_sub_name_space 
)

Definition at line 25 of file TableNameBuilder.php.

28 {
29
30 }

Member Function Documentation

◆ getTableNameFor()

ILIAS\Questions\Persistence\TableNameBuilder::getTableNameFor ( TableTypes  $table,
string  $specifier = '' 
)

Definition at line 32 of file TableNameBuilder.php.

35 : string {
36 if ($table->value === '' && $specifier === '') {
37 throw \InvalidArgumentException(
38 'Identifier cannot be empty if Type->value is empty.'
39 );
40 }
41
42 $base_name = "{$this->component_name_space}";
43 if ($table->value !== '') {
44 $base_name .= "_{$table->value}";
45 }
46
47 $additions = '';
48
49 if ($this->table_sub_name_space !== null) {
50 $additions = $this->table_sub_name_space->get();
51 }
52
53 if ($specifier !== '') {
54 $additions .= "_{$specifier}";
55 }
56
57 if ($additions === '') {
58 return $base_name;
59 }
60
61 return "{$base_name}_{$additions}";
62 }

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