ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.arException.php
Go to the documentation of this file.
1<?php
2require_once('./Services/Exceptions/classes/class.ilException.php');
12{
16 const RECORD_NOT_FOUND = 1003;
17 const GET_UNCACHED_OBJECT = 1004;
18 const LIST_WRONG_LIMIT = 1005;
22 const PRIVATE_CONTRUCTOR = 1009;
23 const FIELD_UNKNOWN = 1010;
27 protected static $message_strings = array(
28 self::UNKNONWN_EXCEPTION => 'Unknown Exception',
29 self::COLUMN_DOES_NOT_EXIST => 'Column does not exist:',
30 self::COLUMN_DOES_ALREADY_EXIST => 'Column does already exist:',
31 self::RECORD_NOT_FOUND => 'No Record found with PrimaryKey:',
32 self::GET_UNCACHED_OBJECT => 'Get uncached Object from Cache:',
33 self::LIST_WRONG_LIMIT => 'Limit, to value smaller than from value:',
34 self::LIST_JOIN_ON_WRONG_FIELD => 'Join on non existing field: ',
35 self::COPY_DESTINATION_ID_EXISTS => 'Copy Record: A record with the Destination-ID already exists.',
36 self::PRIVATE_CONTRUCTOR => 'Constructor cannot be accessed.',
37 self::FIELD_UNKNOWN => 'Field Unknown.',
38 );
42 protected $message = '';
50 protected $additional_info = '';
51
52
57 public function __construct($exception_code = self::UNKNONWN_EXCEPTION, $additional_info = '')
58 {
59 $this->code = $exception_code;
60 $this->additional_info = $additional_info;
61 $this->assignMessageToCode();
62 parent::__construct($this->message, $this->code);
63 }
64
65
66 protected function assignMessageToCode()
67 {
68 $this->message = 'ActiveRecord Exeption: ' . self::$message_strings[$this->code] . $this->additional_info;
69 }
70
71
75 public function __toString()
76 {
77 return implode('<br>', array( get_class($this), $this->message ));
78 }
79}
An exception for terminatinating execution or to throw for unit testing.
Class arException.
const COLUMN_DOES_NOT_EXIST
const LIST_ORDER_BY_WRONG_FIELD
__construct($exception_code=self::UNKNONWN_EXCEPTION, $additional_info='')
const COPY_DESTINATION_ID_EXISTS
const LIST_JOIN_ON_WRONG_FIELD
const COLUMN_DOES_ALREADY_EXIST
const GET_UNCACHED_OBJECT
const UNKNONWN_EXCEPTION
static $message_strings
const PRIVATE_CONTRUCTOR
Base class for ILIAS Exception handling.