Skip to content

Commit

Permalink
fixed executions null variable after deserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Feb 29, 2016
1 parent 6baba87 commit 48082f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# CHANGELOG

* dev-master
* HOTFIX #- Fixed executions null variable after deserialize

* 0.2.0 (2016-02-27)
* ENHANCEMENT #7 Added task execution to hold information for one single try
* FEATURE #6 Added cron task
Expand Down
8 changes: 8 additions & 0 deletions src/Task/Task.php
Expand Up @@ -172,6 +172,10 @@ public function getExecutions()
*/
public function addExecution(TaskExecution $execution)
{
if (!$this->executions) {
$this->executions = new ArrayCollection();
}

$this->executions[] = $execution;
}

Expand All @@ -180,6 +184,10 @@ public function addExecution(TaskExecution $execution)
*/
public function getLastExecution()
{
if (!$this->executions) {
return null;
}

return $this->executions->last();
}
}

0 comments on commit 48082f3

Please sign in to comment.