| 1 | <?php |
||
| 22 | class Event implements EventInterface |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | private $raw; |
||
| 28 | /** |
||
| 29 | * @var mixed |
||
| 30 | */ |
||
| 31 | private $decoded; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param $mandrillEventJson |
||
| 35 | */ |
||
| 36 | public function __construct($mandrillEventJson) |
||
| 37 | { |
||
| 38 | $this->raw = $mandrillEventJson; |
||
| 39 | $this->decoded = json_decode($this->raw()); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * RAW json encoded event object |
||
| 44 | * |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | public function raw() |
||
| 51 | |||
| 52 | |||
| 53 | /** |
||
| 54 | * Time of the event |
||
| 55 | * |
||
| 56 | * @return Carbon |
||
| 57 | */ |
||
| 58 | public function at() |
||
| 62 | |||
| 63 | |||
| 64 | /** |
||
| 65 | * The event type |
||
| 66 | * |
||
| 67 | * @return mixed |
||
| 68 | */ |
||
| 69 | public function type() |
||
| 73 | |||
| 74 | |||
| 75 | /** |
||
| 76 | * Has the event been indexed? |
||
| 77 | * |
||
| 78 | * @return bool |
||
| 79 | */ |
||
| 80 | public function indexed() |
||
| 87 | |||
| 88 | |||
| 89 | /** |
||
| 90 | * Message |
||
| 91 | * |
||
| 92 | * @return Message|null |
||
| 93 | */ |
||
| 94 | public function message() |
||
| 101 | } |
||
| 102 |