/** * @param Model\Document $document * @throws \Zend_Json_Exception */ protected function addSchedulerToDocument(Model\Document $document) { // scheduled tasks if ($this->getParam("scheduler")) { $tasks = array(); $tasksData = \Zend_Json::decode($this->getParam("scheduler")); if (!empty($tasksData)) { foreach ($tasksData as $taskData) { $taskData["date"] = strtotime($taskData["date"] . " " . $taskData["time"]); $task = new Schedule\Task($taskData); $tasks[] = $task; } } if ($document->isAllowed("settings")) { $document->setScheduledTasks($tasks); } } }