We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit b903db05 authored by mattl's avatar mattl

static:: call are less cluttery

parent 6d739789
...@@ -134,7 +134,7 @@ abstract class Managed_DataObject extends Memcached_DataObject ...@@ -134,7 +134,7 @@ abstract class Managed_DataObject extends Memcached_DataObject
* @access public * @access public
* @return array (associative) * @return array (associative)
*/ */
function table() public function table()
{ {
$table = static::schemaDef(); $table = static::schemaDef();
return array_map(array($this, 'columnBitmap'), $table['fields']); return array_map(array($this, 'columnBitmap'), $table['fields']);
...@@ -164,7 +164,7 @@ abstract class Managed_DataObject extends Memcached_DataObject ...@@ -164,7 +164,7 @@ abstract class Managed_DataObject extends Memcached_DataObject
function sequenceKey() function sequenceKey()
{ {
$table = call_user_func(array(get_class($this), 'schemaDef')); $table = static::schemaDef();
foreach ($table['fields'] as $name => $column) { foreach ($table['fields'] as $name => $column) {
if ($column['type'] == 'serial') { if ($column['type'] == 'serial') {
// We have a serial/autoincrement column. // We have a serial/autoincrement column.
...@@ -188,7 +188,7 @@ abstract class Managed_DataObject extends Memcached_DataObject ...@@ -188,7 +188,7 @@ abstract class Managed_DataObject extends Memcached_DataObject
function keyTypes() function keyTypes()
{ {
$table = call_user_func(array(get_class($this), 'schemaDef')); $table = static::schemaDef();
$keys = array(); $keys = array();
if (!empty($table['unique keys'])) { if (!empty($table['unique keys'])) {
...@@ -253,7 +253,7 @@ abstract class Managed_DataObject extends Memcached_DataObject ...@@ -253,7 +253,7 @@ abstract class Managed_DataObject extends Memcached_DataObject
{ {
$links = array(); $links = array();
$table = call_user_func(array(get_class($this), 'schemaDef')); $table = static::schemaDef();
foreach ($table['foreign keys'] as $keyname => $keydef) { foreach ($table['foreign keys'] as $keyname => $keydef) {
if (count($keydef) == 2 && is_string($keydef[0]) && is_array($keydef[1]) && count($keydef[1]) == 1) { if (count($keydef) == 2 && is_string($keydef[0]) && is_array($keydef[1]) && count($keydef[1]) == 1) {
...@@ -274,7 +274,7 @@ abstract class Managed_DataObject extends Memcached_DataObject ...@@ -274,7 +274,7 @@ abstract class Managed_DataObject extends Memcached_DataObject
*/ */
function _allCacheKeys() function _allCacheKeys()
{ {
$table = call_user_func(array(get_class($this), 'schemaDef')); $table = static::schemaDef();
$ckeys = array(); $ckeys = array();
if (!empty($table['unique keys'])) { if (!empty($table['unique keys'])) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment