forked from GNUsocial/gnu-social
Managed_DataObject gets dynamic class detection for staticGet
Compatibility: get_called_class is implemented in PHP >= 5.3.0
This commit is contained in:
parent
3394efca60
commit
d115cddfb7
@ -30,6 +30,21 @@ abstract class Managed_DataObject extends Memcached_DataObject
|
||||
*/
|
||||
public static abstract function schemaDef();
|
||||
|
||||
/**
|
||||
* 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 get_called_class() object if found, or null for no hits
|
||||
*
|
||||
*/
|
||||
static function staticGet($k,$v=NULL)
|
||||
{
|
||||
return parent::staticGet(get_called_class(),$k,$v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get/set an associative array of table columns
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user