mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing more E_STRICT notices and adding a type check to DboSource::dropSchema().
This commit is contained in:
parent
a6c5065e9c
commit
8031d33d33
5 changed files with 8 additions and 20 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue