private function saveLastSendDate() { if ($this->plannedTask->isPrimaryKeyEmpty()) { return; } $dateTime = new Gpf_DateTime(); $this->plannedTask->set(Gpf_Db_Table_PlannedTasks::PARAMS, $dateTime->toDateTime()); $this->plannedTask->save(); }
private function updatePlannedTaskParams() { $plannedTask = new Gpf_Db_PlannedTask(); $plannedTask->setClassName(Pap_Merchants_Config_EmailNotificationsFormBase::REPORTS_SEND_CLASS); $plannedTask->setAccountId($this->task->getAccountId()); try { $plannedTask->loadFromData(array(Gpf_Db_Table_PlannedTasks::CLASSNAME, Gpf_Db_Table_PlannedTasks::ACCOUNTID)); $plannedTask->setParams($this->getSerializedDateParams(Gpf_Common_DateUtils::getDate($this->time))); $plannedTask->setLastPlanDate(Gpf_Common_DateUtils::addDateUnit(Gpf_Common_DateUtils::getDate($this->time), 1, Gpf_Common_DateUtils::DAY)); $plannedTask->save(); } catch (Gpf_Exception $e) { Gpf_Log::error('Error during updating planned ReportsSendTask: ' . $e->getMessage()); } }