throw new ServerException('URL already exists in DB');
}
$sql = 'UPDATE %1$s SET urlhash=%2$s, url=%3$s WHERE urlhash=%4$s;';
- $result = $this->query(sprintf($sql, $this->__table,
+ $result = $this->query(sprintf($sql, $this->tableName(),
$this->_quote((string)self::hashurl($url)),
$this->_quote((string)$url),
$this->_quote((string)$this->urlhash)));
if ($result === false) {
common_log_db_error($this, 'UPDATE', __FILE__);
- throw new ServerException("Could not UPDATE {$this->__table}.url");
+ throw new ServerException("Could not UPDATE {$this->tableName()}.url");
}
return $result;
common_log_db_error($this, 'UPDATE', __FILE__);
// rollback as something bad occurred
$this->query('ROLLBACK');
- throw new ServerException("Could not UPDATE non-keys for {$this->__table}");
+ throw new ServerException("Could not UPDATE non-keys for {$this->tableName()}");
}
$orig->decache();
$this->encache();
common_log_db_error($this, 'UPDATE', __FILE__);
// rollback as something bad occurred
$this->query('ROLLBACK');
- throw new ServerException("Could not UPDATE key fields for {$this->__table}");
+ throw new ServerException("Could not UPDATE key fields for {$this->tableName()}");
}
// Update non-keys too, if the previous endeavour worked.
common_log_db_error($this, 'UPDATE', __FILE__);
// rollback as something bad occurred
$this->query('ROLLBACK');
- throw new ServerException("Could not UPDATE non-keys for {$this->__table}");
+ throw new ServerException("Could not UPDATE non-keys for {$this->tableName()}");
}
$orig->decache();
$this->encache();
}
global $_DB_DATAOBJECT;
- if (!isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"])) {
+ if (!isset($_DB_DATAOBJECT['INI'][$this->_database][$this->tableName()."__keys"])) {
$this->databaseStructure();
}
- return $_DB_DATAOBJECT['INI'][$this->_database][$this->__table."__keys"];
+ return $_DB_DATAOBJECT['INI'][$this->_database][$this->tableName()."__keys"];
}
function encache()
if (!$dsn) {
if (!$this->_database) {
- $this->_database = isset($options["table_{$this->__table}"]) ? $options["table_{$this->__table}"] : null;
+ $this->_database = isset($options["table_{$this->tableName()}"]) ? $options["table_{$this->tableName()}"] : null;
}
if ($this->_database && !empty($options["database_{$this->_database}"])) {
// database loaded - but this is table is not available..
if (
- empty($_DB_DATAOBJECT['INI'][$this->_database][$this->__table])
+ empty($_DB_DATAOBJECT['INI'][$this->_database][$this->tableName()])
&& !empty($_DB_DATAOBJECT['CONFIG']['proxy'])
) {
if (!empty($_DB_DATAOBJECT['CONFIG']['debug'])) {
$x = new DB_DataObject_Generator;
- $x->fillTableSchema($this->_database,$this->__table);
+ $x->fillTableSchema($this->_database,$this->tableName());
}
return true;
}
// now have we loaded the structure..
- if (!empty($_DB_DATAOBJECT['INI'][$this->_database][$this->__table])) {
+ if (!empty($_DB_DATAOBJECT['INI'][$this->_database][$this->tableName()])) {
return true;
}
// - if not try building it..
require_once 'DB/DataObject/Generator.php';
$x = new DB_DataObject_Generator;
- $x->fillTableSchema($this->_database,$this->__table);
+ $x->fillTableSchema($this->_database,$this->tableName());
// should this fail!!!???
return true;
}
- $this->debug("Cant find database schema: {$this->_database}/{$this->__table} \n".
+ $this->debug("Cant find database schema: {$this->_database}/{$this->tableName()} \n".
"in links file data: " . print_r($_DB_DATAOBJECT['INI'],true),"databaseStructure",5);
// we have to die here!! - it causes chaos if we don't (including looping forever!)
// Low level exception. No need for i18n as discussed with Brion.
$sn = new Status_network();
$sn->_connect();
- $config['db']['table_'. $this->__table] = $sn->_database;
+ $config['db']['table_'. $this->tableName()] = $sn->_database;
$this->_connect();
}