ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilDataCollectionInputException.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once './Services/Exceptions/classes/class.ilException.php';
5
18
19 const TYPE_EXCEPTION = 0;
21 const REGEX_EXCEPTION = 2;
23 const NOT_URL = 4;
24 const NOT_IMAGE = 5;
28 protected $exception_type;
29
30
34 public function __construct($exception_type) {
35 parent::__construct($exception_type);
36 $this->exception_type = $exception_type;
37 }
38
39
43 public function getExceptionType() {
45 }
46
47
51 public function __toString() {
52 global $lng;
53
54 switch ($this->exception_type) {
56 return $lng->txt('dcl_wrong_input_type');
58 return $lng->txt('dcl_wrong_length');
60 return $lng->txt('dcl_wrong_regex');
62 return $lng->txt('dcl_unique_exception');
63 case self::NOT_URL:
64 return $lng->txt('dcl_noturl_exception');
65 case self::NOT_IMAGE:
66 return $lng->txt('dcl_notimage_exception');
67 default:
68 return $lng->txt('dcl_unknown_exception');
69 }
70 }
71}
Base class for ILIAS Exception handling.
global $lng
Definition: privfeed.php:40