API CHANGE: Database and Query no longer inherit from Object, since they shouldn't be extended with Extensions.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84061 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-08-08 02:55:32 +00:00
parent 5a7c217ea6
commit be2fea38dd
2 changed files with 5 additions and 8 deletions

View File

@ -5,7 +5,7 @@
* @package sapphire * @package sapphire
* @subpackage model * @subpackage model
*/ */
abstract class Database extends Object { abstract class Database {
/** /**
* This constant was added in SilverStripe 2.4 to indicate that SQL-queries * This constant was added in SilverStripe 2.4 to indicate that SQL-queries
* should now use ANSI-compatible syntax. The most notable affect of this * should now use ANSI-compatible syntax. The most notable affect of this
@ -266,9 +266,9 @@ abstract class Database extends Object {
$this->checkAndRepairTable($table, $options); $this->checkAndRepairTable($table, $options);
// Check if options changed // Check if options changed
if($options && isset($options[$this->class])) { if($options && isset($options[get_class($this)])) {
$tableOptionsChanged = false; $tableOptionsChanged = false;
if(preg_match('/ENGINE=([^\s]*)/', $options[$this->class], $alteredEngineMatches)) { if(preg_match('/ENGINE=([^\s]*)/', $options[get_class($this)], $alteredEngineMatches)) {
$alteredEngine = $alteredEngineMatches[1]; $alteredEngine = $alteredEngineMatches[1];
$tableStatus = DB::query(sprintf( $tableStatus = DB::query(sprintf(
'SHOW TABLE STATUS WHERE "Name" = \'%s\'', 'SHOW TABLE STATUS WHERE "Name" = \'%s\'',
@ -683,7 +683,7 @@ abstract class Database extends Object {
* @package sapphire * @package sapphire
* @subpackage model * @subpackage model
*/ */
abstract class Query extends Object implements Iterator { abstract class Query implements Iterator {
/** /**
* The current record in the interator. * The current record in the interator.
* @var array * @var array

View File

@ -65,8 +65,6 @@ class MySQLDatabase extends Database {
} }
$this->query("SET sql_mode = 'ANSI'"); $this->query("SET sql_mode = 'ANSI'");
parent::__construct();
} }
/** /**
@ -880,7 +878,6 @@ class MySQLQuery extends Query {
public function __construct(MySQLDatabase $database, $handle) { public function __construct(MySQLDatabase $database, $handle) {
$this->database = $database; $this->database = $database;
$this->handle = $handle; $this->handle = $handle;
parent::__construct();
} }
public function __destroy() { public function __destroy() {