add done & delete

This commit is contained in:
DavidBadura
2015-02-05 22:00:30 +00:00
parent 28b61adc99
commit dad551a72a
3 changed files with 151 additions and 6 deletions

View File

@@ -9,6 +9,11 @@ use JMS\Serializer\Annotation as JMS;
*/
class Task
{
const STATUS_PENDING = 'pending';
const STATUS_COMPLETED = 'completed';
const STATUS_DELETED = 'deleted';
const STATUS_WAITING = 'waiting';
/**
* @var string
*
@@ -23,6 +28,21 @@ class Task
*/
private $description;
/**
* @var string
*
* @JMS\Type(name="string")
*/
private $status;
/**
*
*/
public function __construct()
{
$this->status = self::STATUS_PENDING;
}
/**
* @return string
*/
@@ -54,4 +74,52 @@ class Task
{
$this->description = $description;
}
/**
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* @param string $status
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
* @return bool
*/
public function isPending()
{
return $this->status == self::STATUS_PENDING;
}
/**
* @return bool
*/
public function isCompleted()
{
return $this->status == self::STATUS_COMPLETED;
}
/**
* @return bool
*/
public function isWaiting()
{
return $this->status == self::STATUS_WAITING;
}
/**
* @return bool
*/
public function isDeleted()
{
return $this->status == self::STATUS_DELETED;
}
}