chatAcceptedWorkflow() public static méthode

public static chatAcceptedWorkflow ( $options = [], &$chat )
        $chat->unread_messages_informed = 0;
        erLhcoreClassChat::getSession()->update($chat);
        echo $tpl->fetch();
        flush();
        session_write_close();
        if (function_exists('fastcgi_finish_request')) {
            fastcgi_finish_request();
        }
        if ($chatDataChanged == true) {
            erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.data_changed', array('chat' => &$chat, 'user' => $currentUser));
        }
        if ($operatorAccepted == true) {
            erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.accept', array('chat' => &$chat, 'user' => $currentUser));
            erLhcoreClassChat::updateActiveChats($chat->user_id);
            if ($chat->department !== false) {
                erLhcoreClassChat::updateDepartmentStats($chat->department);
            }
            erLhcoreClassChatWorkflow::presendCannedMsg($chat);
            $options = $chat->department->inform_options_array;
            erLhcoreClassChatWorkflow::chatAcceptedWorkflow(array('department' => $chat->department, 'options' => $options), $chat);
        }
        exit;
    }
    echo $tpl->fetch();
    exit;
} else {
    $tpl->setFile('lhchat/errors/adminchatnopermission.tpl.php');
    $tpl->set('show_close_button', true);
    echo $tpl->fetch();
    exit;
}