1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110:
<?php
namespace Donut;
use Ramsey\Uuid\UuidInterface;
class Message
{
const STATUS_NEW = 0;
const STATUS_DONE = 1;
const STATUS_FAILED = 2;
/** @var UuidInterface */
private $id;
/** @var string */
private $queue;
/** @var array */
private $data;
/** @var Time */
private $date;
/** @var Time */
private $created;
/** @var int */
private $status;
/** @var Time|NULL */
private $processed;
public function __construct(UuidInterface $id, $queue, array $data, Time $date, Time $created, $status = self::STATUS_NEW, Time $processed = NULL)
{
$this->id = $id;
$this->queue = $queue;
$this->data = $data;
$this->date = $date;
$this->created = $created;
$this->status = $status;
$this->processed = $processed;
}
/**
* @return UuidInterface
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getQueue()
{
return $this->queue;
}
/**
* @return array
*/
public function getData()
{
return $this->data;
}
/**
* @return Time
*/
public function getDate()
{
return $this->date;
}
/**
* @return Time
*/
public function getCreated()
{
return $this->created;
}
/**
* @return int
*/
public function getStatus()
{
return $this->status;
}
/**
* @return Time|NULL
*/
public function getProcessed()
{
return $this->processed;
}
}