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.
This commit is contained in:
Mikael Nordfeldth 2013-08-18 12:10:44 +02:00
parent c36608b233
commit e95f77d34c
41 changed files with 40 additions and 488 deletions

View File

@ -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);
}
} }

View File

@ -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

View File

@ -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.
*/ */

View File

@ -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
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

View File

@ -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
* *

View File

@ -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
* *

View File

@ -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
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
* *

View File

@ -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
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
* *

View File

@ -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
* *

View File

@ -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
* *

View File

@ -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)
@ -43,17 +43,6 @@ class GNUsocialPhoto extends Memcached_DataObject
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()
{ {
if(!unlink(INSTALLDIR . $this->thumb_uri)) { if(!unlink(INSTALLDIR . $this->thumb_uri)) {

View File

@ -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
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()
{ {

View File

@ -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
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,

View File

@ -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
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,

View File

@ -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)
@ -43,17 +43,6 @@ class GNUsocialPhoto extends Memcached_DataObject
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()
{ {
if(!unlink(INSTALLDIR . $this->thumb_uri)) { if(!unlink(INSTALLDIR . $this->thumb_uri)) {

View File

@ -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
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
* *

View File

@ -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
* *

View File

@ -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
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
* *

View File

@ -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 {
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
* *

View File

@ -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 {
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
* *

View File

@ -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
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
* *

View File

@ -59,7 +59,7 @@ class FeedDBException extends FeedSubException
* Higher-level behavior building OStatus stuff on top is handled * Higher-level behavior building OStatus stuff on top is handled
* under Ostatus_profile. * under Ostatus_profile.
*/ */
class FeedSub extends Memcached_DataObject class FeedSub extends Managed_DataObject
{ {
public $__table = 'feedsub'; public $__table = 'feedsub';
@ -78,11 +78,6 @@ class FeedSub extends Memcached_DataObject
public $created; public $created;
public $modified; public $modified;
public /*static*/ function staticGet($k, $v=null)
{
return parent::staticGet(__CLASS__, $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *

View File

@ -26,7 +26,7 @@ if (!defined('STATUSNET')) {
* @package Hub * @package Hub
* @author Brion Vibber <brion@status.net> * @author Brion Vibber <brion@status.net>
*/ */
class HubSub extends Memcached_DataObject class HubSub extends Managed_DataObject
{ {
public $__table = 'hubsub'; public $__table = 'hubsub';
@ -40,11 +40,6 @@ class HubSub extends Memcached_DataObject
public $created; public $created;
public $modified; public $modified;
public /*static*/ function staticGet($topic, $callback)
{
return parent::staticGet(__CLASS__, 'hashkey', self::hashkey($topic, $callback));
}
protected static function hashkey($topic, $callback) protected static function hashkey($topic, $callback)
{ {
return sha1($topic . '|' . $callback); return sha1($topic . '|' . $callback);

View File

@ -33,7 +33,7 @@ if (!defined('STATUSNET')) {
require_once 'Crypt/RSA.php'; require_once 'Crypt/RSA.php';
class Magicsig extends Memcached_DataObject class Magicsig extends Managed_DataObject
{ {
const PUBLICKEYREL = 'magic-public-key'; const PUBLICKEYREL = 'magic-public-key';
@ -81,32 +81,6 @@ class Magicsig extends Memcached_DataObject
$this->alg = $alg; $this->alg = $alg;
} }
/**
* Fetch a Magicsig object from the cache or database on a field match.
*
* @param string $k
* @param mixed $v
* @return Magicsig
*/
public /*static*/ function staticGet($k, $v=null)
{
$obj = parent::staticGet(__CLASS__, $k, $v);
if (!empty($obj)) {
$obj = Magicsig::fromString($obj->keypair);
// Double check keys: Crypt_RSA did not
// consistently generate good keypairs.
// We've also moved to 1024 bit keys.
if (strlen($obj->publicKey->modulus->toBits()) != 1024) {
$obj->delete();
return false;
}
}
return $obj;
}
function table() function table()
{ {
return array( return array(

View File

@ -25,7 +25,7 @@ if (!defined('STATUSNET')) {
* @package OStatusPlugin * @package OStatusPlugin
* @maintainer Brion Vibber <brion@status.net> * @maintainer Brion Vibber <brion@status.net>
*/ */
class Ostatus_source extends Memcached_DataObject class Ostatus_source extends Managed_DataObject
{ {
public $__table = 'ostatus_source'; public $__table = 'ostatus_source';
@ -33,11 +33,6 @@ class Ostatus_source extends Memcached_DataObject
public $profile_uri; // uri of the ostatus_profile this came through -- may be a group feed public $profile_uri; // uri of the ostatus_profile this came through -- may be a group feed
public $method; // push or salmon public $method; // push or salmon
public /*static*/ function staticGet($k, $v=null)
{
return parent::staticGet(__CLASS__, $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *

View File

@ -7,7 +7,7 @@ if (!defined('STATUSNET')) {
exit(1); exit(1);
} }
class User_openid extends Memcached_DataObject class User_openid 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 */
@ -19,10 +19,6 @@ class User_openid extends Memcached_DataObject
public $created; // datetime() not_null public $created; // datetime() not_null
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=null)
{ return Memcached_DataObject::staticGet('User_openid',$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

View File

@ -7,7 +7,7 @@ if (!defined('STATUSNET')) {
exit(1); exit(1);
} }
class User_openid_trustroot extends Memcached_DataObject class User_openid_trustroot 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 */
@ -18,10 +18,6 @@ class User_openid_trustroot extends Memcached_DataObject
public $created; // datetime() not_null public $created; // datetime() not_null
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
/* Static get */
function staticGet($k,$v=null)
{ return Memcached_DataObject::staticGet('User_openid_trustroot',$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

View File

@ -42,27 +42,13 @@ 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 Registration_ip extends Memcached_DataObject class Registration_ip extends Managed_DataObject
{ {
public $__table = 'registration_ip'; // table name public $__table = 'registration_ip'; // table name
public $user_id; // int(4) primary_key not_null public $user_id; // int(4) primary_key not_null
public $ipaddress; // varchar(15) public $ipaddress; // varchar(15)
public $created; // timestamp public $created; // timestamp
/**
* 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 User_greeting_count object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Registration_ip', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *

View File

@ -52,27 +52,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class User_greeting_count extends Memcached_DataObject class User_greeting_count extends Managed_DataObject
{ {
public $__table = 'user_greeting_count'; // table name public $__table = 'user_greeting_count'; // table name
public $user_id; // int(4) primary_key not_null public $user_id; // int(4) primary_key not_null
public $greeting_count; // int(4) public $greeting_count; // int(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('User_greeting_count', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *

View File

@ -51,7 +51,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Sitemap_notice_count extends Memcached_DataObject class Sitemap_notice_count extends Managed_DataObject
{ {
public $__table = 'sitemap_notice_count'; // table name public $__table = 'sitemap_notice_count'; // table name
@ -60,22 +60,6 @@ class Sitemap_notice_count extends Memcached_DataObject
public $created; public $created;
public $modified; public $modified;
/**
* 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 'notice_id' for this class)
* @param mixed $v Value to lookup
*
* @return Sitemap_notice_count object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Sitemap_notice_count', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *

View File

@ -47,7 +47,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Sitemap_user_count extends Memcached_DataObject class Sitemap_user_count extends Managed_DataObject
{ {
public $__table = 'sitemap_user_count'; // table name public $__table = 'sitemap_user_count'; // table name
@ -56,22 +56,6 @@ class Sitemap_user_count extends Memcached_DataObject
public $created; public $created;
public $modified; public $modified;
/**
* 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 Sitemap_user_count object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Sitemap_user_count', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *

View File

@ -22,7 +22,7 @@
* @maintainer Brion Vibber <brion@status.net> * @maintainer Brion Vibber <brion@status.net>
*/ */
class SubMirror extends Memcached_DataObject class SubMirror extends Managed_DataObject
{ {
public $__table = 'submirror'; public $__table = 'submirror';
@ -34,11 +34,6 @@ class SubMirror extends Memcached_DataObject
public $created; public $created;
public $modified; public $modified;
public /*static*/ function staticGet($k, $v=null)
{
return parent::staticGet(__CLASS__, $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *

View File

@ -53,29 +53,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* @see DB_DataObject * @see DB_DataObject
*/ */
class Notice_to_status extends Memcached_DataObject class Notice_to_status extends Managed_DataObject
{ {
public $__table = 'notice_to_status'; // table name public $__table = 'notice_to_status'; // table name
public $notice_id; // int(4) primary_key not_null public $notice_id; // int(4) primary_key not_null
public $status_id; // int(4) public $status_id; // int(4)
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_status object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Notice_to_status', $k, $v);
}
/** /**
* return table definition for DB_DataObject * return table definition for DB_DataObject
* *

View File

@ -48,7 +48,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
* *
* @see DB_DataObject * @see DB_DataObject
*/ */
class Twitter_synch_status extends Memcached_DataObject class Twitter_synch_status extends Managed_DataObject
{ {
public $__table = 'twitter_synch_status'; // table name public $__table = 'twitter_synch_status'; // table name
public $foreign_id; // int(4) primary_key not_null public $foreign_id; // int(4) primary_key not_null
@ -65,7 +65,7 @@ class Twitter_synch_status extends Memcached_DataObject
* *
* @return Twitter_synch_status object found, or null for no hits * @return Twitter_synch_status object found, or null for no hits
*/ */
function staticGet($k, $v=null) static function staticGet($k, $v=null)
{ {
throw new Exception("Use pkeyGet() for this class."); throw new Exception("Use pkeyGet() for this class.");
} }

View File

@ -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 User_flag_profile extends Memcached_DataObject class User_flag_profile 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 */
@ -55,9 +55,6 @@ class User_flag_profile extends Memcached_DataObject
public $created; // datetime not_null default_0000-00-00%2000%3A00%3A00 public $created; // datetime not_null default_0000-00-00%2000%3A00%3A00
public $cleared; // datetime not_null default_0000-00-00%2000%3A00%3A00 public $cleared; // datetime not_null default_0000-00-00%2000%3A00%3A00
/* Static get */
function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('User_flag_profile',$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

View File

@ -35,12 +35,12 @@ if (!defined('STATUSNET')) {
* Common base class for the Yammer import mappings for users, groups, and notices. * Common base class for the Yammer import mappings for users, groups, and notices.
* *
* Child classes must override these static methods, since we need to run * Child classes must override these static methods, since we need to run
* on PHP 5.2.x which has no late static binding: * on PHP 5.2.x which has no late static binding: (not really anymore)
* - staticGet (as our other classes) * - staticGet (as our other classes)
* - schemaDef (call self::doSchemaDef) * - schemaDef (call self::doSchemaDef)
* - record (call self::doRecord) * - record (call self::doRecord)
*/ */
class Yammer_common extends Memcached_DataObject class Yammer_common extends Managed_DataObject
{ {
public $__table = 'yammer_XXXX'; // table name public $__table = 'yammer_XXXX'; // table name
public $__field = 'XXXX_id'; // field name to save into public $__field = 'XXXX_id'; // field name to save into
@ -133,13 +133,13 @@ class Yammer_common extends Memcached_DataObject
*/ */
protected static function doRecord($class, $field, $orig_id, $local_id) protected static function doRecord($class, $field, $orig_id, $local_id)
{ {
$map = parent::staticGet($class, 'id', $orig_id); $map = Memcached_DataObject::staticGet($class, 'id', $orig_id);
if (!empty($map)) { if (!empty($map)) {
return $map; return $map;
} }
$map = parent::staticGet($class, $field, $local_id); $map = Memcached_DataObject::staticGet($class, $field, $local_id);
if (!empty($map)) { if (!empty($map)) {
return $map; return $map;

View File

@ -37,22 +37,6 @@ class Yammer_group extends Yammer_common
public $__field = 'group_id'; // field to map to public $__field = 'group_id'; // field to map to
public $group_id; // int public $group_id; // int
/**
* 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 Yammer_group object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Yammer_group', $k, $v);
}
/** /**
* Return schema definition to set this table up in onCheckSchema * Return schema definition to set this table up in onCheckSchema
*/ */

View File

@ -37,22 +37,6 @@ class Yammer_notice extends Yammer_common
public $__field = 'notice_id'; // field to map to public $__field = 'notice_id'; // field to map to
public $notice_id; // int public $notice_id; // int
/**
* 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 Yammer_notice object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Yammer_notice', $k, $v);
}
/** /**
* Return schema definition to set this table up in onCheckSchema * Return schema definition to set this table up in onCheckSchema
*/ */

View File

@ -40,28 +40,13 @@ if (!defined('STATUSNET')) {
* down in reverse chronological order, then go back over them from oldest to * down in reverse chronological order, then go back over them from oldest to
* newest and actually save them into our notice table. * newest and actually save them into our notice table.
*/ */
class Yammer_notice_stub extends Memcached_DataObject class Yammer_notice_stub extends Managed_DataObject
{ {
public $__table = 'yammer_notice_stub'; // table name public $__table = 'yammer_notice_stub'; // table name
public $id; // int primary_key not_null public $id; // int primary_key not_null
public $json_data; // text public $json_data; // text
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 Yammer_notice_stub object found, or null for no hits
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Yammer_notice_stub', $k, $v);
}
/** /**
* Return schema definition to set this table up in onCheckSchema * Return schema definition to set this table up in onCheckSchema
*/ */

View File

@ -31,7 +31,7 @@ if (!defined('STATUSNET')) {
exit(1); exit(1);
} }
class Yammer_state extends Memcached_DataObject class Yammer_state extends Managed_DataObject
{ {
public $__table = 'yammer_state'; // table name public $__table = 'yammer_state'; // table name
public $id; // int primary_key not_null public $id; // int primary_key not_null
@ -46,21 +46,6 @@ class Yammer_state extends Memcached_DataObject
public $created; // datetime public $created; // datetime
public $modified; // datetime public $modified; // 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 Yammer_state object found, or null for no hits
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Yammer_state', $k, $v);
}
/** /**
* Return schema definition to set this table up in onCheckSchema * Return schema definition to set this table up in onCheckSchema
*/ */

View File

@ -37,22 +37,6 @@ class Yammer_user extends Yammer_common
public $__field = 'user_id'; // field to map to public $__field = 'user_id'; // field to map to
public $user_id; // int public $user_id; // int
/**
* 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 Yammer_user object found, or null for no hits
*
*/
function staticGet($k, $v=null)
{
return Memcached_DataObject::staticGet('Yammer_user', $k, $v);
}
/** /**
* Return schema definition to set this table up in onCheckSchema * Return schema definition to set this table up in onCheckSchema
*/ */