ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.arException.php
Go to the documentation of this file.
1<?php
2
25class arException extends ilException implements \Stringable
26{
27 public const UNKNONWN_EXCEPTION = -1;
28 public const COLUMN_DOES_NOT_EXIST = 1001;
29 public const COLUMN_DOES_ALREADY_EXIST = 1002;
30 public const RECORD_NOT_FOUND = 1003;
31 public const GET_UNCACHED_OBJECT = 1004;
32 public const LIST_WRONG_LIMIT = 1005;
33 public const LIST_ORDER_BY_WRONG_FIELD = 1006;
34 public const LIST_JOIN_ON_WRONG_FIELD = 1007;
35 public const COPY_DESTINATION_ID_EXISTS = 1008;
36 public const PRIVATE_CONTRUCTOR = 1009;
37 public const FIELD_UNKNOWN = 1010;
38 protected static array $message_strings = [
39 self::UNKNONWN_EXCEPTION => 'Unknown Exception',
40 self::COLUMN_DOES_NOT_EXIST => 'Column does not exist:',
41 self::COLUMN_DOES_ALREADY_EXIST => 'Column does already exist:',
42 self::RECORD_NOT_FOUND => 'No Record found with PrimaryKey:',
43 self::GET_UNCACHED_OBJECT => 'Get uncached Object from Cache:',
44 self::LIST_WRONG_LIMIT => 'Limit, to value smaller than from value:',
45 self::LIST_JOIN_ON_WRONG_FIELD => 'Join on non existing field: ',
46 self::COPY_DESTINATION_ID_EXISTS => 'Copy Record: A record with the Destination-ID already exists.',
47 self::PRIVATE_CONTRUCTOR => 'Constructor cannot be accessed.',
48 self::FIELD_UNKNOWN => 'Field Unknown.'
49 ];
53 protected $message = '';
54
59 public function __construct(protected $code = self::UNKNONWN_EXCEPTION, protected $additional_info = '')
60 {
61 $this->assignMessageToCode();
62 parent::__construct($this->message, $this->code);
63 }
64
65 protected function assignMessageToCode(): void
66 {
67 $this->message = 'ActiveRecord Exeption: ' . self::$message_strings[$this->code] . $this->additional_info;
68 }
69
70 public function __toString(): string
71 {
72 return implode('<br>', [static::class, $this->message]);
73 }
74}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const COLUMN_DOES_NOT_EXIST
const LIST_ORDER_BY_WRONG_FIELD
__construct(protected $code=self::UNKNONWN_EXCEPTION, protected $additional_info='')
const COPY_DESTINATION_ID_EXISTS
static array $message_strings
const LIST_JOIN_ON_WRONG_FIELD
const COLUMN_DOES_ALREADY_EXIST
const GET_UNCACHED_OBJECT
const UNKNONWN_EXCEPTION
const PRIVATE_CONTRUCTOR
Base class for ILIAS Exception handling.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc