fist draft
This commit is contained in:
33
src/Task.php
33
src/Task.php
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user