add recurring object

This commit is contained in:
DavidBadura
2015-02-08 13:00:15 +00:00
parent 7199ad4dfa
commit 0d5a2b46e6
6 changed files with 238 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ class Task
/**
* @var string
*
* @JMS\Type("string")
* @JMS\Type("Recurring")
*/
private $recur;
@@ -269,11 +269,19 @@ class Task
}
/**
* @param string $recur
* @param string|Recurring $recur
* @throws TaskwarriorException
*/
public function setRecur($recur)
{
$this->recur = $recur;
if (is_string($recur)) {
$this->recur = new Recurring($recur);
} elseif ($recur instanceof Recurring) {
$this->recur = $recur;
} else {
throw new TaskwarriorException();
}
}
/**