Skip to content

Commit

Permalink
Allow deep clone of child objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Oct 19, 2015
1 parent dd91cfc commit 0ded907
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nag/lib/Task.php
Expand Up @@ -371,6 +371,17 @@ public function __set($name, $value)
E_USER_NOTICE);
}

/**
* Deep clone so we can clone the child objects too.
*
*/
public function __clone()
{
foreach ($this->children as $key => $value) {
$this->children[$key] = clone $value;
}
}

/**
* Merges a task hash into this task object.
*
Expand Down

0 comments on commit 0ded907

Please sign in to comment.