| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Description of PermanentAlert |
| 5 |
* |
| 6 |
* @author Ali2Woo Team |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace AliNext_Lite;; |
| 10 |
|
| 11 |
class PermanentAlert |
| 12 |
{ |
| 13 |
public const TYPE_INFO = 'info'; |
| 14 |
public const TYPE_SUCCESS = 'success'; |
| 15 |
public const TYPE_ERROR = 'danger'; |
| 16 |
|
| 17 |
public function __construct( |
| 18 |
private string $content, |
| 19 |
private string $type = self::TYPE_INFO |
| 20 |
) {} |
| 21 |
|
| 22 |
public function getContent(): string |
| 23 |
{ |
| 24 |
return $this->content; |
| 25 |
} |
| 26 |
|
| 27 |
public function getType(): string |
| 28 |
{ |
| 29 |
return $this->type; |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Static builder for convenience |
| 34 |
*/ |
| 35 |
public static function build(string $content, string $type = self::TYPE_INFO): self |
| 36 |
{ |
| 37 |
return new self($content, $type); |
| 38 |
} |
| 39 |
} |
| 40 |
|