Fixing more E_STRICT notices and adding a type check to DboSource::dropSchema().

This commit is contained in:
mark_story 2010-12-04 14:37:02 -05:00
parent a6c5065e9c
commit 8031d33d33
5 changed files with 8 additions and 20 deletions

View file

@ -500,16 +500,12 @@ class DboMysql extends DboSource {
/**
* Generate a MySQL "drop table" statement for the given Schema object
*
* @param object $schema An instance of a subclass of CakeSchema
* @param CakeSchema $schema An instance of a subclass of CakeSchema
* @param string $table Optional. If specified only the table name given will be generated.
* Otherwise, all tables defined in the schema are generated.
* @return string
*/
function dropSchema($schema, $table = null) {
if (!is_a($schema, 'CakeSchema')) {
trigger_error(__('Invalid schema object'), E_USER_WARNING);
return null;
}
function dropSchema(CakeSchema $schema, $table = null) {
$out = '';
foreach ($schema->tables as $curTable => $columns) {
if (!$table || $table == $curTable) {

View file

@ -1121,16 +1121,12 @@ class DboOracle extends DboSource {
/**
* Generate a "drop table" statement for the given Schema object
*
* @param object $schema An instance of a subclass of CakeSchema
* @param CakeSchema $schema An instance of a subclass of CakeSchema
* @param string $table Optional. If specified only the table name given will be generated.
* Otherwise, all tables defined in the schema are generated.
* @return string
*/
function dropSchema($schema, $table = null) {
if (!is_a($schema, 'CakeSchema')) {
trigger_error(__('Invalid schema object'), E_USER_WARNING);
return null;
}
function dropSchema(CakeSchema $schema, $table = null) {
$out = '';
foreach ($schema->tables as $curTable => $columns) {

View file

@ -138,7 +138,7 @@ class DboSqlite extends DboSource {
* @return array Array of tablenames in the database
* @access public
*/
function listSources() {
function listSources($data = null) {
$cache = parent::listSources();
if ($cache != null) {
return $cache;

View file

@ -2801,16 +2801,12 @@ class DboSource extends DataSource {
/**
* Generate a "drop table" statement for the given Schema object
*
* @param object $schema An instance of a subclass of CakeSchema
* @param CakeSchema $schema An instance of a subclass of CakeSchema
* @param string $table Optional. If specified only the table name given will be generated.
* Otherwise, all tables defined in the schema are generated.
* @return string
*/
public function dropSchema($schema, $table = null) {
if (!is_a($schema, 'CakeSchema')) {
trigger_error(__('Invalid schema object'), E_USER_WARNING);
return null;
}
public function dropSchema(CakeSchema $schema, $table = null) {
$out = '';
foreach ($schema->tables as $curTable => $columns) {

View file

@ -42,7 +42,7 @@ class DboSqliteTestDb extends DboSqlite {
* @access protected
* @return void
*/
function _execute($sql) {
function _execute($sql, $params = array()) {
$this->simulated[] = $sql;
return null;
}