fist draft

This commit is contained in:
DavidBadura
2015-07-07 23:17:00 +00:00
parent 855cfad124
commit 44d518e95a
7 changed files with 260 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ namespace DavidBadura\Taskwarrior;
use Carbon\Carbon;
use DavidBadura\Taskwarrior\Exception\DatetimeParseException;
use Doctrine\Common\Collections\ArrayCollection;
use JMS\Serializer\Annotation as JMS;
/**
@@ -126,6 +127,13 @@ class Task
*/
private $status;
/**
* @var Task[]|ArrayCollection
*
* @JMS\Type("Depends")
*/
private $depends;
/**
*
*/
@@ -134,6 +142,7 @@ class Task
$this->urgency = 0;
$this->entry = new Carbon('now');
$this->status = self::STATUS_PENDING;
$this->depends = new ArrayCollection();
}
/**
@@ -268,6 +277,30 @@ class Task
}
}
/**
* @return Task[]|ArrayCollection
*/
public function getDependencies()
{
return $this->depends;
}
/**
* @param Task $task
*/
public function addDependency(Task $task)
{
$this->depends->add($task);
}
/**
* @param Task $task
*/
public function removeDependency(Task $task)
{
$this->depends->removeElement($task);
}
/**
* @return Recurring
*/