add dates & urgency

This commit is contained in:
DavidBadura
2015-02-05 23:09:29 +00:00
parent dad551a72a
commit a25b90caba
4 changed files with 130 additions and 85 deletions

View File

@@ -9,10 +9,10 @@ use JMS\Serializer\Annotation as JMS;
*/
class Task
{
const STATUS_PENDING = 'pending';
const STATUS_PENDING = 'pending';
const STATUS_COMPLETED = 'completed';
const STATUS_DELETED = 'deleted';
const STATUS_WAITING = 'waiting';
const STATUS_DELETED = 'deleted';
const STATUS_WAITING = 'waiting';
/**
* @var string
@@ -28,6 +28,27 @@ class Task
*/
private $description;
/**
* @var \DateTime
*
* @JMS\Type(name="DateTime<'Ymd\THis\Z'>")
*/
private $due;
/**
* @var float
*
* @JMS\Type(name="float")
*/
private $urgency;
/**
* @var \DateTime
*
* @JMS\Type(name="DateTime<'Ymd\THis\Z'>")
*/
private $entry;
/**
* @var string
*
@@ -40,7 +61,9 @@ class Task
*/
public function __construct()
{
$this->status = self::STATUS_PENDING;
$this->urgency = 0;
$this->entry = new \DateTime('now', new \DateTimeZone('UTC'));
$this->status = self::STATUS_PENDING;
}
/**
@@ -51,14 +74,6 @@ class Task
return $this->uuid;
}
/**
* @param string $uuid
*/
public function setUuid($uuid)
{
$this->uuid = $uuid;
}
/**
* @return string
*/
@@ -75,6 +90,38 @@ class Task
$this->description = $description;
}
/**
* @return \DateTime
*/
public function getDue()
{
return $this->due;
}
/**
* @param \DateTime $due
*/
public function setDue(\DateTime $due = null)
{
$this->due = $due;
}
/**
* @return \DateTime
*/
public function getEntry()
{
return $this->entry;
}
/**
* @return float
*/
public function getUrgency()
{
return $this->urgency;
}
/**
* @return string
*/
@@ -83,14 +130,6 @@ class Task
return $this->status;
}
/**
* @param string $status
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
* @return bool
*/