Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
CRUDMessage.php
Go to the documentation of this file.
1<?php
2
4
6 private $message;
7 private $type;
8 private $icon;
9 private $title;
10 private $timeout;
11 private $_message;
12
13 public function __construct($message,$title="",$type="",$icon="",$timeout=null){
14 $this->message=$message;
15 $this->title=$title;
16 $this->type=$type;
17 $this->icon=$icon;
18 $this->timeout=$timeout;
19 $this->_message=$message;
20 }
21
25 public function getMessage(): string {
26 return $this->_message;
27 }
28
32 public function getType(): string {
33 return $this->type;
34 }
35
39 public function getIcon(): string {
40 return $this->icon;
41 }
42
46 public function getTitle(): string {
47 return $this->title;
48 }
49
54 public function setMessage(string $message): CRUDMessage {
55 $this->_message = $message;
56 $this->message=$message;
57 return $this;
58 }
59
64 public function setType(string $type): CRUDMessage {
65 $this->type = $type;
66 return $this;
67 }
68
73 public function setIcon(string $icon): CRUDMessage {
74 $this->icon = $icon;
75 return $this;
76 }
77
82 public function setTitle(string $title): CRUDMessage {
83 $this->title = $title;
84 return $this;
85 }
86
90 public function getTimeout(): ?int {
91 return $this->timeout;
92 }
93
98 public function setTimeout(int $timeout): CRUDMessage {
99 $this->timeout = $timeout;
100 return $this;
101 }
102
108 public function parse(string $value): CRUDMessage {
109 $this->_message=\str_replace("{value}", $value, $this->message);
110 return $this;
111 }
112
117 public function parseContent(array $keyValues): CRUDMessage {
118 $msg=$this->_message;
119 foreach ($keyValues as $key=>$value){
120 $msg=str_replace("{".$key."}", $value, $msg);
121 }
122 $this->_message=$msg;
123 return $this;
124 }
125
126}
127
__construct($message, $title="", $type="", $icon="", $timeout=null)