Created
October 23, 2012 20:48
-
-
Save chrisjdavis/3941451 to your computer and use it in GitHub Desktop.
Quickchat Plural 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 | |
/** | |
* Quickchats Class | |
* | |
*/ | |
class Quickchats extends Posts | |
{ | |
public static function get($paramarray = array()) { | |
$defaults = array( | |
'content_type' => 'quickchat', | |
'fetch_class' => 'Quickchat', | |
); | |
$paramarray = array_merge($defaults, Utils::get_params($paramarray)); | |
return Posts::get( $paramarray ); | |
} | |
public static function active() { | |
$chats = array(); | |
$user = User::identify(); | |
foreach( Quickchats::get(array('sender_id' => $user->id)) as $yours ) { | |
$chats[] = $yours; | |
} | |
foreach( Quickchats::get(array('receiver_id' => $user->id)) as $theirs ) { | |
$chats[] = $theirs; | |
} | |
return $chats; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment