Notice.php
122 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Analyst\Notices; |
| 4 | |
| 5 | class Notice |
| 6 | { |
| 7 | /** |
| 8 | * Id of notice |
| 9 | * |
| 10 | * @var string |
| 11 | */ |
| 12 | protected $id; |
| 13 | |
| 14 | /** |
| 15 | * Body of notice |
| 16 | * |
| 17 | * @var string |
| 18 | */ |
| 19 | protected $body; |
| 20 | |
| 21 | /** |
| 22 | * Account id |
| 23 | * |
| 24 | * @var string |
| 25 | */ |
| 26 | protected $accountId; |
| 27 | |
| 28 | /** |
| 29 | * The plugin name |
| 30 | * |
| 31 | * @var string |
| 32 | */ |
| 33 | protected $pluginName; |
| 34 | |
| 35 | /** |
| 36 | * New notice |
| 37 | * |
| 38 | * @param $id |
| 39 | * @param $accountId |
| 40 | * @param $body |
| 41 | * @param null $pluginName |
| 42 | * |
| 43 | * @return Notice |
| 44 | */ |
| 45 | public static function make($id, $accountId, $body, $pluginName = null) |
| 46 | { |
| 47 | return new Notice($id, $accountId, $body, $pluginName); |
| 48 | } |
| 49 | |
| 50 | public function __construct($id, $accountId, $body, $pluginName) |
| 51 | { |
| 52 | $this->setId($id); |
| 53 | $this->setBody($body); |
| 54 | $this->setAccountId($accountId); |
| 55 | $this->setPluginName($pluginName); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * @return string |
| 60 | */ |
| 61 | public function getId() |
| 62 | { |
| 63 | return $this->id; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @param string $id |
| 68 | */ |
| 69 | public function setId($id) |
| 70 | { |
| 71 | $this->id = $id; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * @return string |
| 76 | */ |
| 77 | public function getBody() |
| 78 | { |
| 79 | return $this->body; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * @param string $body |
| 84 | */ |
| 85 | public function setBody($body) |
| 86 | { |
| 87 | $this->body = $body; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * @return string |
| 92 | */ |
| 93 | public function getAccountId() |
| 94 | { |
| 95 | return $this->accountId; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * @param string $accountId |
| 100 | */ |
| 101 | public function setAccountId($accountId) |
| 102 | { |
| 103 | $this->accountId = $accountId; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * @return string|null |
| 108 | */ |
| 109 | public function getPluginName() |
| 110 | { |
| 111 | return $this->pluginName; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * @param string $pluginName |
| 116 | */ |
| 117 | public function setPluginName($pluginName) |
| 118 | { |
| 119 | $this->pluginName = $pluginName; |
| 120 | } |
| 121 | } |
| 122 |