Fixed yii\db\BaseActiveRecord::deleteAll() changes method signature declared by yii\db\ActiveRecordInterface::deleteAll()

This commit is contained in:
Klimov Paul
2017-02-09 12:16:04 +02:00
parent 7e8d9c5c5f
commit 319e27c45c
3 changed files with 4 additions and 5 deletions

View File

@ -4,7 +4,7 @@ Yii Framework 2 Change Log
2.0.12 under development 2.0.12 under development
-------------------------- --------------------------
- no changes in this release. - Bug #13538: Fixed `yii\db\BaseActiveRecord::deleteAll()` changes method signature declared by `yii\db\ActiveRecordInterface::deleteAll()` (klimov-paul)
2.0.11.2 February 08, 2017 2.0.11.2 February 08, 2017

View File

@ -288,7 +288,7 @@ class ActiveRecord extends BaseActiveRecord
* @param array $params the parameters (name => value) to be bound to the query. * @param array $params the parameters (name => value) to be bound to the query.
* @return int the number of rows deleted * @return int the number of rows deleted
*/ */
public static function deleteAll($condition = '', $params = []) public static function deleteAll($condition = null, $params = [])
{ {
$command = static::getDb()->createCommand(); $command = static::getDb()->createCommand();
$command->delete(static::tableName(), $condition, $params); $command->delete(static::tableName(), $condition, $params);

View File

@ -192,11 +192,10 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
* *
* @param string|array $condition the conditions that will be put in the WHERE part of the DELETE SQL. * @param string|array $condition the conditions that will be put in the WHERE part of the DELETE SQL.
* Please refer to [[Query::where()]] on how to specify this parameter. * Please refer to [[Query::where()]] on how to specify this parameter.
* @param array $params the parameters (name => value) to be bound to the query.
* @return int the number of rows deleted * @return int the number of rows deleted
* @throws NotSupportedException if not overrided * @throws NotSupportedException if not overridden.
*/ */
public static function deleteAll($condition = '', $params = []) public static function deleteAll($condition = null)
{ {
throw new NotSupportedException(__METHOD__ . ' is not supported.'); throw new NotSupportedException(__METHOD__ . ' is not supported.');
} }