ILIAS  release_8 Revision v8.24
exception.ilAtomQueryException.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
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 protected function tranlateException(int $code): string
41 {
42 $message = 'An undefined Exception occured';
43 switch ($code) {
44 case static::DB_ATOM_GENERAL:
45 $message = 'An undefined exception in ilAtomQuery has occured';
46 break;
47 case static::DB_ATOM_LOCK_TABLE_NONEXISTING:
48 $message = 'Table locks only work with existing tables';
49 break;
50 case static::DB_ATOM_LOCK_WRONG_LEVEL:
51 $message = 'The current Isolation-level does not support the desired lock-level. use ilAtomQuery::LOCK_READ or ilAtomQuery::LOCK_WRITE';
52 break;
53 case static::DB_ATOM_CLOSURE_WRONG_FORMAT:
54 $message = 'Please provide a Closure with your database-actions by adding with ilAtomQuery->addQueryClosure(function($ilDB) use ($my_vars) { $ilDB->doStuff(); });';
55 break;
56 case static::DB_ATOM_ISO_WRONG_LEVEL:
57 $message = 'This isolation-level is currently unsupported';
58 break;
59 case static::DB_ATOM_ANO_NOT_AVAILABLE:
60 $message = 'Anomaly not available';
61 break;
62 case static::DB_ATOM_LOCK_NO_TABLE:
63 $message = 'ilAtomQuery needs at least one table to be locked';
64 break;
65 case static::DB_ATOM_CLOSURE_NONE:
66 $message = 'There is no Closure available';
67 break;
68 case static::DB_ATOM_CLOSURE_ALREADY_SET:
69 $message = 'Only one Closure per ilAtomQuery is possible';
70 break;
71 case static::DB_ATOM_IDENTICAL_TABLES:
72 $message = 'A Table and/or alias-name can only be locked once';
73 break;
74 }
75
76 return 'ilAtomQuery: ' . $message . '. ';
77 }
78}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$message
Definition: xapiexit.php:32