ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TableNamesHandler.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
31
32trait TableNamesHandler
33{
34 protected function checkTable(string $table): void
35 {
36 if (
37 is_null($this->table($table)) ||
38 is_null($this->IDName($table))
39 ) {
40 throw new \ilMDRepositoryException('Invalid MD table: ' . $table);
41 }
42 }
43
44 protected function table(string $table): ?string
45 {
46 return LOMDictionaryInitiator::TABLES[$table] ?? null;
47 }
48
49 protected function IDName(string $table): ?string
50 {
51 return LOMDictionaryInitiator::ID_NAME[$table] ?? null;
52 }
53}