public function createReportSendLog() { $destinations = ScheduleTypeReportDestination::getList($this->schedule_type_report->ex_schedule_id); if (is_array($destinations)) { foreach ($destinations as $destItem) { $sendLog = ScheduleTypeReportSendLog::isExist($this->schedule_type_report_processed->getSavedPk(), $destItem->ex_schedule_destination_id); if (!$sendLog) { $sendLog = new ScheduleTypeReportSendLog(); $sendLog->ex_schedule_processed_id = $this->schedule_type_report_processed->getSavedPk(); $sendLog->ex_schedule_destination_id = $destItem->ex_schedule_destination_id; $sendLog->sent = 0; $sendLog->save(); } } } }