/** * Set helpdesk notification type */ public function actionSetNotificationType() { $helpdesks = HelpDesk::findAll([]); if (!empty($helpdesks)) { foreach ($helpdesks as $helpdesk) { if (!isset($helpdesk->notificationType)) { $helpdesk->notificationType = HelpDesk::NOTIFICATION_TYPE_DESKTOP_MARK; if ($helpdesk->save()) { echo "Success to set notification type to helpdesk " . $helpdesk->_id . "\n"; } else { echo "Fail to set notification type to helpdesk " . $helpdesk->_id . " successfully" . "\n"; } } } } }