From dd028bec3822d1d9c28c35d599d687e038c7705f Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 4 Jan 2007 11:23:26 +0000 Subject: Add chat demo and tutorial. --- demos/chat/protected/App_Code/ChatUserRecord.php | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 demos/chat/protected/App_Code/ChatUserRecord.php (limited to 'demos/chat/protected/App_Code/ChatUserRecord.php') diff --git a/demos/chat/protected/App_Code/ChatUserRecord.php b/demos/chat/protected/App_Code/ChatUserRecord.php new file mode 100644 index 00000000..9bfb11cd --- /dev/null +++ b/demos/chat/protected/App_Code/ChatUserRecord.php @@ -0,0 +1,41 @@ +_last_activity === null) + $this->_last_activity = time(); + return $this->_last_activity; + } + + public function setLast_Activity($value) + { + $this->_last_activity = $value; + } + + public static function finder() + { + return parent::getRecordFinder('ChatUserRecord'); + } + + public function getUserList() + { + $this->deleteAll('last_activity < ?', time()-300); //5 min inactivity + $content = ''; + + return $content; + } +} + +?> \ No newline at end of file -- cgit v1.2.3