public static function timeoutWorkflow(erLhcoreClassModelChat &$chat)
{
$msg = new erLhcoreClassModelmsg();
$msg->msg = trim($chat->timeout_message);
$msg->chat_id = $chat->id;
$msg->name_support = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Live Support');
$msg->user_id = -2;
$msg->time = time();
erLhcoreClassChat::getSession()->save($msg);
if ($chat->last_msg_id < $msg->id) {
$chat->last_msg_id = $msg->id;
}
$chat->wait_timeout_send++;
if ($chat->wait_timeout_send == 1) {
$chat->timeout_message = '';
}
$chat->updateThis();
}