Created
October 23, 2012 20:48
-
-
Save chrisjdavis/3941445 to your computer and use it in GitHub Desktop.
Quickchat Singular Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Quickchat extends Post | |
{ | |
public static function get($paramarray = array()) { | |
$defaults = array( | |
'content_type' => 'quickchat', | |
'fetch_fn' => 'get_row', | |
'limit' => 1, | |
'fetch_class' => 'Quickchat', | |
); | |
$paramarray = array_merge($defaults, Utils::get_params($paramarray)); | |
return Posts::get( $paramarray ); | |
} | |
public static function lines($chat) { | |
return DB::get_results( "SELECT message from {quickchat_lines} WHERE chat_id = $chat ORDER BY date ASC" ); | |
} | |
public function jsonSerialize() { | |
$array = array_merge( $this->fields, $this->newfields ); | |
return json_encode($array); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment