*
* @see DB_DataObject
*/
-class Group_message extends Memcached_DataObject
+class Group_message extends Managed_DataObject
{
public $__table = 'group_message'; // table name
public $id; // char(36) primary_key not_null
public $url;
public $created;
- /**
- * Get an instance by key
- *
- * This is a utility method to get a single instance with a given key value.
- *
- * @param string $k Key to use to lookup (usually 'user_id' for this class)
- * @param mixed $v Value to lookup
- *
- * @return Group_message object found, or null for no hits
- */
- function staticGet($k, $v=null)
- {
- return Memcached_DataObject::staticGet('Group_message', $k, $v);
- }
-
/**
* return table definition for DB_DataObject
*
function distribute()
{
- $group = User_group::staticGet('id', $this->to_group);
+ $group = User_group::getKV('id', $this->to_group);
$member = $group->getMembers();
function getGroup()
{
- $group = User_group::staticGet('id', $this->to_group);
+ $group = User_group::getKV('id', $this->to_group);
if (empty($group)) {
// TRANS: Exception thrown when trying to send group private message to a non-existing group.
throw new ServerException(_m('No group for group message.'));
function getSender()
{
- $sender = Profile::staticGet('id', $this->from_profile);
+ $sender = Profile::getKV('id', $this->from_profile);
if (empty($sender)) {
// TRANS: Exception thrown when trying to send group private message without having a sender.
throw new ServerException(_m('No sender for group message.'));