public function saveScheduledTasks()
{
$scheduled_tasks = $this->getScheduledTasks();
$this->getDao()->deleteAllTasks();
if (is_array($scheduled_tasks) && count($scheduled_tasks) > 0) {
foreach ($scheduled_tasks as $task) {
$task->setId(null);
$task->setDao(null);
$task->setCid($this->getId());
$task->setCtype("document");
$task->save();
}
}
}