ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
exception.ilAtomQueryException.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 public const DB_ATOM_GENERAL = 10900;
29 public const DB_ATOM_LOCK_TABLE_NONEXISTING = 10901;
30 public const DB_ATOM_LOCK_WRONG_LEVEL = 10902;
31 public const DB_ATOM_CLOSURE_WRONG_FORMAT = 10903;
32 public const DB_ATOM_ISO_WRONG_LEVEL = 10904;
33 public const DB_ATOM_ANO_NOT_AVAILABLE = 10905;
34 public const DB_ATOM_LOCK_NO_TABLE = 10906;
35 public const DB_ATOM_CLOSURE_NONE = 10907;
36 public const DB_ATOM_CLOSURE_ALREADY_SET = 10908;
37 public const DB_ATOM_IDENTICAL_TABLES = 10909;
38
39
40 #[\Override]
41 protected function tranlateException(int $code): string
42 {
43 $message = 'An undefined Exception occured';
44 switch ($code) {
45 case static::DB_ATOM_GENERAL:
46 $message = 'An undefined exception in ilAtomQuery has occured';
47 break;
48 case static::DB_ATOM_LOCK_TABLE_NONEXISTING:
49 $message = 'Table locks only work with existing tables';
50 break;
51 case static::DB_ATOM_LOCK_WRONG_LEVEL:
52 $message = 'The current Isolation-level does not support the desired lock-level. use ilAtomQuery::LOCK_READ or ilAtomQuery::LOCK_WRITE';
53 break;
54 case static::DB_ATOM_CLOSURE_WRONG_FORMAT:
55 $message = 'Please provide a Closure with your database-actions by adding with ilAtomQuery->addQueryClosure(function($ilDB) use ($my_vars) { $ilDB->doStuff(); });';
56 break;
57 case static::DB_ATOM_ISO_WRONG_LEVEL:
58 $message = 'This isolation-level is currently unsupported';
59 break;
60 case static::DB_ATOM_ANO_NOT_AVAILABLE:
61 $message = 'Anomaly not available';
62 break;
63 case static::DB_ATOM_LOCK_NO_TABLE:
64 $message = 'ilAtomQuery needs at least one table to be locked';
65 break;
66 case static::DB_ATOM_CLOSURE_NONE:
67 $message = 'There is no Closure available';
68 break;
69 case static::DB_ATOM_CLOSURE_ALREADY_SET:
70 $message = 'Only one Closure per ilAtomQuery is possible';
71 break;
72 case static::DB_ATOM_IDENTICAL_TABLES:
73 $message = 'A Table and/or alias-name can only be locked once';
74 break;
75 }
76
77 return 'ilAtomQuery: ' . $message . '. ';
78 }
79}
Class ilAtomQueryException.
Class ilDatabaseException.
$message
Definition: xapiexit.php:31