|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace AVATOR\TurbosmsBundle\Entity; |
| 4 | + |
| 5 | +/** |
| 6 | + * Class TurboSmsSent |
| 7 | + * @package AVATOR\TurbosmsBundle\Entity |
| 8 | + */ |
| 9 | +class TurboSmsSent |
| 10 | +{ |
| 11 | + const STATUS_SENT = 1; |
| 12 | + |
| 13 | + /** |
| 14 | + * @var integer |
| 15 | + */ |
| 16 | + private $id; |
| 17 | + |
| 18 | + /** |
| 19 | + * @var string |
| 20 | + */ |
| 21 | + private $phone = ''; |
| 22 | + |
| 23 | + /** |
| 24 | + * @var string |
| 25 | + */ |
| 26 | + private $message_id = ''; |
| 27 | + |
| 28 | + /** |
| 29 | + * @var string |
| 30 | + */ |
| 31 | + private $status = ''; |
| 32 | + |
| 33 | + /** |
| 34 | + * @var string |
| 35 | + */ |
| 36 | + private $status_message = ''; |
| 37 | + |
| 38 | + /** |
| 39 | + * @var string |
| 40 | + */ |
| 41 | + private $message = ''; |
| 42 | + |
| 43 | + /** |
| 44 | + * @var \DateTime |
| 45 | + */ |
| 46 | + private $created_at; |
| 47 | + |
| 48 | + /** |
| 49 | + * @var \DateTime |
| 50 | + */ |
| 51 | + private $updated_at; |
| 52 | + |
| 53 | + public function __construct() |
| 54 | + { |
| 55 | + $this->setStatus(self::STATUS_SENT); |
| 56 | + } |
| 57 | + |
| 58 | + /** |
| 59 | + * Get id |
| 60 | + * |
| 61 | + * @return integer |
| 62 | + */ |
| 63 | + public function getId() |
| 64 | + { |
| 65 | + return $this->id; |
| 66 | + } |
| 67 | + |
| 68 | + /** |
| 69 | + * Set phone |
| 70 | + * |
| 71 | + * @param string $phone |
| 72 | + * |
| 73 | + * @return TurboSmsSent |
| 74 | + */ |
| 75 | + public function setPhone($phone) |
| 76 | + { |
| 77 | + $this->phone = $phone; |
| 78 | + |
| 79 | + return $this; |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * Get phone |
| 84 | + * |
| 85 | + * @return string |
| 86 | + */ |
| 87 | + public function getPhone() |
| 88 | + { |
| 89 | + return $this->phone; |
| 90 | + } |
| 91 | + |
| 92 | + /** |
| 93 | + * Set messageId |
| 94 | + * |
| 95 | + * @param string $messageId |
| 96 | + * |
| 97 | + * @return TurboSmsSent |
| 98 | + */ |
| 99 | + public function setMessageId($messageId) |
| 100 | + { |
| 101 | + $this->message_id = $messageId; |
| 102 | + |
| 103 | + return $this; |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * Get messageId |
| 108 | + * |
| 109 | + * @return string |
| 110 | + */ |
| 111 | + public function getMessageId() |
| 112 | + { |
| 113 | + return $this->message_id; |
| 114 | + } |
| 115 | + |
| 116 | + /** |
| 117 | + * Set status |
| 118 | + * |
| 119 | + * @param string $status |
| 120 | + * |
| 121 | + * @return TurboSmsSent |
| 122 | + */ |
| 123 | + public function setStatus($status) |
| 124 | + { |
| 125 | + $this->status = $status; |
| 126 | + |
| 127 | + return $this; |
| 128 | + } |
| 129 | + |
| 130 | + /** |
| 131 | + * Get status |
| 132 | + * |
| 133 | + * @return string |
| 134 | + */ |
| 135 | + public function getStatus() |
| 136 | + { |
| 137 | + return $this->status; |
| 138 | + } |
| 139 | + |
| 140 | + /** |
| 141 | + * Set statusMessage |
| 142 | + * |
| 143 | + * @param string $statusMessage |
| 144 | + * |
| 145 | + * @return TurboSmsSent |
| 146 | + */ |
| 147 | + public function setStatusMessage($statusMessage) |
| 148 | + { |
| 149 | + $this->status_message = $statusMessage; |
| 150 | + |
| 151 | + return $this; |
| 152 | + } |
| 153 | + |
| 154 | + /** |
| 155 | + * Get statusMessage |
| 156 | + * |
| 157 | + * @return string |
| 158 | + */ |
| 159 | + public function getStatusMessage() |
| 160 | + { |
| 161 | + return $this->status_message; |
| 162 | + } |
| 163 | + |
| 164 | + /** |
| 165 | + * Set message |
| 166 | + * |
| 167 | + * @param string $message |
| 168 | + * |
| 169 | + * @return TurboSmsSent |
| 170 | + */ |
| 171 | + public function setMessage($message) |
| 172 | + { |
| 173 | + $this->message = $message; |
| 174 | + |
| 175 | + return $this; |
| 176 | + } |
| 177 | + |
| 178 | + /** |
| 179 | + * Get message |
| 180 | + * |
| 181 | + * @return string |
| 182 | + */ |
| 183 | + public function getMessage() |
| 184 | + { |
| 185 | + return $this->message; |
| 186 | + } |
| 187 | + |
| 188 | + /** |
| 189 | + * Set createdAt |
| 190 | + * |
| 191 | + * @param \DateTime $createdAt |
| 192 | + * |
| 193 | + * @return TurboSmsSent |
| 194 | + */ |
| 195 | + public function setCreatedAt($createdAt) |
| 196 | + { |
| 197 | + $this->created_at = $createdAt; |
| 198 | + |
| 199 | + return $this; |
| 200 | + } |
| 201 | + |
| 202 | + /** |
| 203 | + * Get createdAt |
| 204 | + * |
| 205 | + * @return \DateTime |
| 206 | + */ |
| 207 | + public function getCreatedAt() |
| 208 | + { |
| 209 | + return $this->created_at; |
| 210 | + } |
| 211 | + |
| 212 | + /** |
| 213 | + * Set updatedAt |
| 214 | + * |
| 215 | + * @param \DateTime $updatedAt |
| 216 | + * |
| 217 | + * @return TurboSmsSent |
| 218 | + */ |
| 219 | + public function setUpdatedAt($updatedAt) |
| 220 | + { |
| 221 | + $this->updated_at = $updatedAt; |
| 222 | + |
| 223 | + return $this; |
| 224 | + } |
| 225 | + |
| 226 | + /** |
| 227 | + * Get updatedAt |
| 228 | + * |
| 229 | + * @return \DateTime |
| 230 | + */ |
| 231 | + public function getUpdatedAt() |
| 232 | + { |
| 233 | + return $this->updated_at; |
| 234 | + } |
| 235 | + |
| 236 | + /** |
| 237 | + * @ORM\PrePersist |
| 238 | + */ |
| 239 | + public function onInsert() |
| 240 | + { |
| 241 | + $this->setCreatedAt(new \DateTime()); |
| 242 | + $this->setUpdatedAt(new \DateTime()); |
| 243 | + } |
| 244 | + |
| 245 | + /** |
| 246 | + * @ORM\PreUpdate |
| 247 | + */ |
| 248 | + public function onUpdate() |
| 249 | + { |
| 250 | + $this->setUpdatedAt(new \DateTime()); |
| 251 | + } |
| 252 | + |
| 253 | +} |
| 254 | + |
0 commit comments