public static function getBrowseInstance(erLhcoreClassModelChat $chat) { $coBrowseSession = null; $cobrowse = erLhcoreClassModelCoBrowse::getList(array('filter' => array('chat_id' => $chat->id))); if (empty($cobrowse)) { $coBrowseSession = new erLhcoreClassModelCoBrowse(); $coBrowseSession->chat_id = $chat->id; } else { $coBrowseSession = array_pop($cobrowse); } return $coBrowseSession; }
public static function getBrowseInstanceByOnlineUser(erLhcoreClassModelChatOnlineUser $ouser) { $coBrowseSession = null; $cobrowse = erLhcoreClassModelCoBrowse::getList(array('filter' => array('online_user_id' => $ouser->id))); if (empty($cobrowse)) { $coBrowseSession = new erLhcoreClassModelCoBrowse(); $coBrowseSession->online_user_id = $ouser->id; } else { $coBrowseSession = array_pop($cobrowse); } return $coBrowseSession; }