git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit e95f77d3 authored by mmn's avatar mmn

Updating all Memcached_DataObject extended classes to Managed_DataObject

In some brief tests, this causes no problems.

In this state however, you would need to modify DB_DataObject to have a static declaration of staticget (and probably pkeyGet). The next commit will change the staticGet overload to a unique function name (like getKV for getKeyValue), which means we can properly call the function by PHP Strict Standards.
parent c36608b2
...@@ -81,8 +81,4 @@ class Old_school_prefs extends Managed_DataObject ...@@ -81,8 +81,4 @@ class Old_school_prefs extends Managed_DataObject
), ),
); );
} }
function staticGet($k,$v=NULL) {
return Memcached_DataObject::staticGet('Old_school_prefs',$k,$v);
}
} }
...@@ -42,7 +42,7 @@ class Status_network extends Safe_DataObject ...@@ -42,7 +42,7 @@ class Status_network extends Safe_DataObject
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */ /* Static get */
function staticGet($k,$v=NULL) { static function staticGet($k,$v=NULL) {
$i = DB_DataObject::staticGet('Status_network',$k,$v); $i = DB_DataObject::staticGet('Status_network',$k,$v);
// Don't use local process cache; if we're fetching multiple // Don't use local process cache; if we're fetching multiple
......
...@@ -50,20 +50,6 @@ class Unavailable_status_network extends Managed_DataObject ...@@ -50,20 +50,6 @@ class Unavailable_status_network extends Managed_DataObject
public $nickname; // varchar(64) UUID public $nickname; // varchar(64) UUID
public $created; // datetime public $created; // datetime
/**
* Get an instance by key
*
* @param string $k Key to use to lookup (usually 'id' for this class)
* @param mixed $v Value to lookup
*
* @return Happening object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Unavailable_status_network', $k, $v);
}
/** /**
* The One True Thingy that must be defined and declared. * The One True Thingy that must be defined and declared.
*/ */
......
...@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/ * @link http://status.net/
*/ */
class Fave_tally extends Memcached_DataObject class Fave_tally extends Managed_DataObject
{ {
###START_AUTOCODE ###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */ /* the code below is auto generated do not remove the above tag */
...@@ -54,9 +54,6 @@ class Fave_tally extends Memcached_DataObject ...@@ -54,9 +54,6 @@ class Fave_tally extends Memcached_DataObject
public $count; // int(4) not_null public $count; // int(4) not_null
public $modified; // datetime not_null default_0000-00-00%2000%3A00%3A00 public $modified; // datetime not_null default_0000-00-00%2000%3A00%3A00
/* Static get */
function staticGet($k, $v = NULL) { return Memcached_DataObject::staticGet('Fave_tally', $k, $v); }
/* the code above is auto generated do not remove the tag below */ /* the code above is auto generated do not remove the tag below */
###END_AUTOCODE ###END_AUTOCODE
......
...@@ -44,28 +44,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -44,28 +44,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Homepage_blacklist extends Memcached_DataObject class Homepage_blacklist extends Managed_DataObject
{ {
public $__table = 'homepage_blacklist'; // table name public $__table = 'homepage_blacklist'; // table name
public $pattern; // string pattern public $pattern; // string pattern
public $created; // datetime public $created; // datetime
/**
* 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 Homepage_blacklist object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Homepage_blacklist', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -44,28 +44,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -44,28 +44,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Nickname_blacklist extends Memcached_DataObject class Nickname_blacklist extends Managed_DataObject
{ {
public $__table = 'nickname_blacklist'; // table name public $__table = 'nickname_blacklist'; // table name
public $pattern; // string pattern public $pattern; // string pattern
public $created; // datetime public $created; // datetime
/**
* 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
* @param mixed $v Value to lookup
*
* @return Nickname_blacklist object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Nickname_blacklist', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -42,7 +42,7 @@ if (!defined('STATUSNET')) { ...@@ -42,7 +42,7 @@ if (!defined('STATUSNET')) {
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Bookmark extends Memcached_DataObject class Bookmark extends Managed_DataObject
{ {
public $__table = 'bookmark'; // table name public $__table = 'bookmark'; // table name
public $id; // char(36) primary_key not_null public $id; // char(36) primary_key not_null
...@@ -53,22 +53,6 @@ class Bookmark extends Memcached_DataObject ...@@ -53,22 +53,6 @@ class Bookmark extends Memcached_DataObject
public $uri; // varchar(255) public $uri; // varchar(255)
public $created; // datetime public $created; // datetime
/**
* 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 User_greeting_count object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Bookmark', $k, $v);
}
/** /**
* Get an instance by compound key * Get an instance by compound key
* *
......
...@@ -46,7 +46,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -46,7 +46,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Email_summary_status extends Memcached_DataObject class Email_summary_status extends Managed_DataObject
{ {
public $__table = 'email_summary_status'; // table name public $__table = 'email_summary_status'; // table name
public $user_id; // int(4) primary_key not_null public $user_id; // int(4) primary_key not_null
...@@ -55,20 +55,6 @@ class Email_summary_status extends Memcached_DataObject ...@@ -55,20 +55,6 @@ class Email_summary_status extends Memcached_DataObject
public $created; // datetime not_null public $created; // datetime not_null
public $modified; // datetime not_null public $modified; // datetime not_null
/**
* Get an instance by key
*
* @param string $k Key to use to lookup (usually 'user_id' for this class)
* @param mixed $v Value to lookup
*
* @return Email_summary_status object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('email_summary_status', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -48,29 +48,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -48,29 +48,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Notice_to_item extends Memcached_DataObject class Notice_to_item extends Managed_DataObject
{ {
public $__table = 'notice_to_item'; // table name public $__table = 'notice_to_item'; // table name
public $notice_id; // int(4) primary_key not_null public $notice_id; // int(4) primary_key not_null
public $item_id; // varchar(255) not null public $item_id; // varchar(255) not null
public $created; // datetime public $created; // datetime
/**
* 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
* @param mixed $v Value to lookup
*
* @return Notice_to_item object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Notice_to_item', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -52,27 +52,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -52,27 +52,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class User_followeveryone_prefs extends Memcached_DataObject class User_followeveryone_prefs extends Managed_DataObject
{ {
public $__table = 'user_followeveryone_prefs'; // table name public $__table = 'user_followeveryone_prefs'; // table name
public $user_id; // int(4) primary_key not_null public $user_id; // int(4) primary_key not_null
public $followeveryone; // tinyint(1) public $followeveryone; // tinyint(1)
/**
* 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 User_followeveryone_prefs object found, or null for no hits
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('User_followeveryone_prefs', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) { ...@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) {
require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
class GNUsocialPhoto extends Memcached_DataObject class GNUsocialPhoto extends Managed_DataObject
{ {
public $__table = 'GNUsocialPhoto'; public $__table = 'GNUsocialPhoto';
public $id; // int(11) public $id; // int(11)
...@@ -42,17 +42,6 @@ class GNUsocialPhoto extends Memcached_DataObject ...@@ -42,17 +42,6 @@ class GNUsocialPhoto extends Memcached_DataObject
public $thumb_uri; // varchar(512) public $thumb_uri; // varchar(512)
public $title; // varchar(512) public $title; // varchar(512)
public $photo_description; // text public $photo_description; // text
/**
*
* k key
* v value
*/
function staticGet($k,$v=NULL)
{
return Memcached_DataObject::staticGet('GNUsocialPhoto',$k,$v);
}
/* function delete() /* function delete()
{ {
......
...@@ -33,7 +33,7 @@ if (!defined('STATUSNET')) { ...@@ -33,7 +33,7 @@ if (!defined('STATUSNET')) {
require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
class GNUsocialPhotoAlbum extends Memcached_DataObject class GNUsocialPhotoAlbum extends Managed_DataObject
{ {
public $__table = 'GNUsocialPhotoAlbum'; public $__table = 'GNUsocialPhotoAlbum';
public $album_id; // int(11) -- Unique identifier for the album public $album_id; // int(11) -- Unique identifier for the album
...@@ -41,13 +41,6 @@ class GNUsocialPhotoAlbum extends Memcached_DataObject ...@@ -41,13 +41,6 @@ class GNUsocialPhotoAlbum extends Memcached_DataObject
public $album_name; // varchar(256) -- Title for this album public $album_name; // varchar(256) -- Title for this album
public $album_description; // text -- A description of the album public $album_description; // text -- A description of the album
function staticGet($k,$v=NULL)
{
return Memcached_DataObject::staticGet('GNUsocialPhotoAlbum',$k,$v);
}
/* TODO: Primary key on both album_id, profile_id / foriegn key on profile_id */ /* TODO: Primary key on both album_id, profile_id / foriegn key on profile_id */
function table() function table()
{ {
......
...@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) { ...@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) {
require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
class GNUsocialProfileExtensionField extends Memcached_DataObject class GNUsocialProfileExtensionField extends Managed_DataObject
{ {
public $__table = 'GNUsocialProfileExtensionField'; public $__table = 'GNUsocialProfileExtensionField';
public $id; // int(11) public $id; // int(11)
...@@ -41,17 +41,6 @@ class GNUsocialProfileExtensionField extends Memcached_DataObject ...@@ -41,17 +41,6 @@ class GNUsocialProfileExtensionField extends Memcached_DataObject
public $description; // text public $description; // text
public $type; // varchar(256) public $type; // varchar(256)
/**
*
* k key
* v value
*/
function staticGet($k,$v=NULL)
{
return Memcached_DataObject::staticGet('GNUsocialProfileExtensionField',$k,$v);
}
function table() function table()
{ {
return array('id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, return array('id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
......
...@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) { ...@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) {
require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
class GNUsocialProfileExtensionResponse extends Memcached_DataObject class GNUsocialProfileExtensionResponse extends Managed_DataObject
{ {
public $__table = 'GNUsocialProfileExtensionResponse'; public $__table = 'GNUsocialProfileExtensionResponse';
public $id; // int(11) public $id; // int(11)
...@@ -40,17 +40,6 @@ class GNUsocialProfileExtensionResponse extends Memcached_DataObject ...@@ -40,17 +40,6 @@ class GNUsocialProfileExtensionResponse extends Memcached_DataObject
public $profile_id; // int(11) public $profile_id; // int(11)
public $value; // text public $value; // text
/**
*
* k key
* v value
*/
function staticGet($k,$v=NULL)
{
return Memcached_DataObject::staticGet('GNUsocialProfileExtensionResponse',$k,$v);
}
function table() function table()
{ {
return array('id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, return array('id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
......
...@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) { ...@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) {
require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
class GNUsocialPhoto extends Memcached_DataObject class GNUsocialPhoto extends Managed_DataObject
{ {
public $__table = 'GNUsocialPhoto'; public $__table = 'GNUsocialPhoto';
public $id; // int(11) public $id; // int(11)
...@@ -42,17 +42,6 @@ class GNUsocialPhoto extends Memcached_DataObject ...@@ -42,17 +42,6 @@ class GNUsocialPhoto extends Memcached_DataObject
public $thumb_uri; // varchar(512) public $thumb_uri; // varchar(512)
public $title; // varchar(512) public $title; // varchar(512)
public $photo_description; // text public $photo_description; // text
/**
*
* k key
* v value
*/
function staticGet($k,$v=NULL)
{
return Memcached_DataObject::staticGet('GNUsocialPhoto',$k,$v);
}
/* function delete() /* function delete()
{ {
......
...@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Group_message extends Memcached_DataObject class Group_message extends Managed_DataObject
{ {
public $__table = 'group_message'; // table name public $__table = 'group_message'; // table name
public $id; // char(36) primary_key not_null public $id; // char(36) primary_key not_null
...@@ -56,21 +56,6 @@ class Group_message extends Memcached_DataObject ...@@ -56,21 +56,6 @@ class Group_message extends Memcached_DataObject
public $url; public $url;
public $created; 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 * return table definition for DB_DataObject
* *
......
...@@ -44,28 +44,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -44,28 +44,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Group_message_profile extends Memcached_DataObject class Group_message_profile extends Managed_DataObject
{ {
public $__table = 'group_message_profile'; // table name public $__table = 'group_message_profile'; // table name
public $to_profile; // int public $to_profile; // int
public $group_message_id; // char(36) primary_key not_null public $group_message_id; // char(36) primary_key not_null
public $created; 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_profile', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -44,7 +44,7 @@ if (!defined('STATUSNET')) { ...@@ -44,7 +44,7 @@ if (!defined('STATUSNET')) {
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Group_privacy_settings extends Memcached_DataObject class Group_privacy_settings extends Managed_DataObject
{ {
public $__table = 'group_privacy_settings'; public $__table = 'group_privacy_settings';
/** ID of the group. */ /** ID of the group. */
...@@ -70,21 +70,6 @@ class Group_privacy_settings extends Memcached_DataObject ...@@ -70,21 +70,6 @@ class Group_privacy_settings extends Memcached_DataObject
const MEMBER = 2; const MEMBER = 2;
const ADMIN = 4; const ADMIN = 4;
/**
* 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 User_greeting_count object found, or null for no hits
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Group_privacy_settings', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
class Irc_waiting_message extends Memcached_DataObject { class Irc_waiting_message extends Managed_DataObject {
public $__table = 'irc_waiting_message'; // table name public $__table = 'irc_waiting_message'; // table name
public $id; // int primary_key not_null auto_increment public $id; // int primary_key not_null auto_increment
...@@ -15,11 +15,6 @@ class Irc_waiting_message extends Memcached_DataObject { ...@@ -15,11 +15,6 @@ class Irc_waiting_message extends Memcached_DataObject {
public $created; // datetime() not_null public $created; // datetime() not_null
public $claimed; // datetime() public $claimed; // datetime()
/* Static get */
public function staticGet($k, $v = null) {
return Memcached_DataObject::staticGet('Irc_waiting_message', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*/ */
require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
class Msn_waiting_message extends Memcached_DataObject { class Msn_waiting_message extends Managed_DataObject {
public $__table = 'msn_waiting_message'; // table name public $__table = 'msn_waiting_message'; // table name
public $id; // int primary_key not_null auto_increment public $id; // int primary_key not_null auto_increment
...@@ -13,11 +13,6 @@ class Msn_waiting_message extends Memcached_DataObject { ...@@ -13,11 +13,6 @@ class Msn_waiting_message extends Memcached_DataObject {
public $created; // datetime() not_null public $created; // datetime() not_null
public $claimed; // datetime() public $claimed; // datetime()
/* Static get */
public function staticGet($k, $v = null) {
return Memcached_DataObject::staticGet('Msn_waiting_message', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *
......
...@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; ...@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Notice_title extends Memcached_DataObject class Notice_title extends Managed_DataObject
{ {
const MAXCHARS = 255; const MAXCHARS = 255;
...@@ -52,22 +52,6 @@ class Notice_title extends Memcached_DataObject ...@@ -52,22 +52,6 @@ class Notice_title extends Memcached_DataObject
public $notice_id; // int(4) primary_key not_null public $notice_id; // int(4) primary_key not_null
public $title; // varchar(255) public $title; // varchar(255)
/**
* 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 Notice_title object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Notice_title', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject