From 11c68a1b6a127d08fe9e9d94aee3044c76802d60 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 17 Oct 2007 16:40:26 -0400 Subject: [PATCH] In Api.php we were still calling BSApp::GetType() instead of BSApp::Registry()->getType() * Api.php --- Api.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Api.php b/Api.php index 42705c7..da33e77 100644 --- a/Api.php +++ b/Api.php @@ -201,7 +201,7 @@ abstract class BSApi throw new Exception('Field "' . $field . '" is not valid'); } - $this->values["$field"] = ($doclean ? BSApp::GetType('Input')->clean($value, $this->fields["$field"][F_TYPE]) : $value); + $this->values["$field"] = ($doclean ? BSApp::Registry()->getType('Input')->clean($value, $this->fields["$field"][F_TYPE]) : $value); $this->setfields["$field"] = $field; @@ -301,7 +301,7 @@ abstract class BSApi $this->_runActionMethod('pre_fetch', $doPre); - $result = BSApp::GetType('Db')->queryFirst("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); + $result = BSApp::Registry()->getType('Db')->queryFirst("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); if (!$result) { return false; @@ -334,9 +334,9 @@ abstract class BSApi $values[] = $this->_prepareFieldForSql($field); } - BSApp::GetType('Db')->query("INSERT INTO {$this->prefix}{$this->table} (" . implode(',', $fields) . ") VALUES (" . implode(',', $values) . ")"); + BSApp::Registry()->getType('Db')->query("INSERT INTO {$this->prefix}{$this->table} (" . implode(',', $fields) . ") VALUES (" . implode(',', $values) . ")"); - if (BSApp::GetType('DbPostgreSql')) + if (BSApp::Registry()->getType('DbPostgreSql')) { foreach ($this->fields AS $field => $info) { @@ -347,11 +347,11 @@ abstract class BSApi } } - $this->insertid = BSApp::GetType('Db')->insertId($this->prefix . $this->table, $autofield); + $this->insertid = BSApp::Registry()->getType('Db')->insertId($this->prefix . $this->table, $autofield); } else { - $this->insertid = BSApp::GetType('Db')->insertId(); + $this->insertid = BSApp::Registry()->getType('Db')->insertId(); } $this->_runActionMethod('post_insert', $doPost); @@ -381,7 +381,7 @@ abstract class BSApi } $updates = implode(', ', $updates); - BSApp::GetType('Db')->query("UPDATE {$this->prefix}{$this->table} SET $updates WHERE {$this->condition}"); + BSApp::Registry()->getType('Db')->query("UPDATE {$this->prefix}{$this->table} SET $updates WHERE {$this->condition}"); $this->_runActionMethod('post_update', $doPost); } @@ -404,7 +404,7 @@ abstract class BSApi $this->_runActionMethod('pre_remove', $doPre); - BSApp::GetType('Db')->query("DELETE FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); + BSApp::Registry()->getType('Db')->query("DELETE FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); $this->_runActionMethod('post_remove', $doPost); } @@ -463,7 +463,7 @@ abstract class BSApi if ($type == TYPE_NONE OR $type == TYPE_STR OR $type == TYPE_STRUN) { - return "'" . BSApp::GetType('Db')->escapeString($this->values["$name"]) . "'"; + return "'" . BSApp::Registry()->getType('Db')->escapeString($this->values["$name"]) . "'"; } else if ($type == TYPE_BOOL) { @@ -471,7 +471,7 @@ abstract class BSApi } else if ($type == TYPE_BIN) { - return "'" . BSApp::GetType('Db')->escapeBinary($this->values["$name"]) . "'"; + return "'" . BSApp::Registry()->getType('Db')->escapeBinary($this->values["$name"]) . "'"; } else { @@ -513,7 +513,7 @@ abstract class BSApi */ protected function verify_unique($field) { - $res = BSApp::GetType('Db')->queryFirst("SELECT $field FROM {$this->prefix}{$this->table} WHERE $field = " . $this->_prepareFieldForSql($field) . (empty($this->condition) ? "" : " AND !({$this->condition})")); + $res = BSApp::Registry()->getType('Db')->queryFirst("SELECT $field FROM {$this->prefix}{$this->table} WHERE $field = " . $this->_prepareFieldForSql($field) . (empty($this->condition) ? "" : " AND !({$this->condition})")); if ($res) { return new Exception(sprintf(_('The "%1$s" field must contain a unique value'), $field), $field); -- 2.22.5