ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilSystemStyleMessage.php
Go to the documentation of this file.
1<?php
9
10 const TYPE_INFO = 0;
11 const TYPE_SUCCESS = 1;
12 const TYPE_ERROR = 2;
13
17 protected $message = "";
18
23
29 public function __construct($message, $type_id = self::TYPE_SUCCESS)
30 {
31 $this->setMessage($message);
32 $this->setTypeId($type_id);
33 }
34
35
39 public function getMessageOutput()
40 {
41 return $this->message."</br>";
42 }
43
47 public function getMessage()
48 {
49 return $this->message;
50 }
51
55 public function setMessage($message)
56 {
57 $this->message = $message;
58 }
59
63 public function getTypeId()
64 {
65 return $this->type_id;
66 }
67
72 public function setTypeId($type_id)
73 {
74 if($this->isValidTypeId($type_id)){
75 $this->type_id = $type_id;
76 }else{
78 }
79 }
80
81 protected function isValidTypeId($type_id){
82 switch($type_id){
84 case self::TYPE_INFO:
86 return true;
87 default:
88 return false;
89 }
90 }
91}
An exception for terminatinating execution or to throw for unit testing.
Class for advanced editing exception handling in ILIAS.
__construct($message, $type_id=self::TYPE_SUCCESS)
ilMessageStack constructor.