deleteAll() public static method

WARNING: If you do not specify any condition, this method will delete ALL rows in the table. For example, to delete all customers whose status is 3: php Customer::deleteAll('status = 3');
public static deleteAll ( string | array $condition = '', array $params = [] ) : integer
$condition string | array 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.
$params array the parameters (name => value) to be bound to the query.
return integer the number of rows deleted
 /** @inheritdoc */
 public static function deleteAll($condition = '', $params = [])
 {
     $r = parent::deleteAll($condition, $params);
     static::afterBatchDelete($condition, $params);
     return $r;
 }
 /**
  * 重写删除函数,支持主键删除自动清理Cache
  * @param $condition
  * @param array $params
  * @return int
  */
 public static function deteteAll($condition, $params = [])
 {
     $ret = parent::deleteAll($condition, $params);
     if ($ret && self::allowFromCache($condition)) {
         $cache_key = self::getCacheKey($condition[static::$pk], false);
         Yii::trace('delete cache:' . $cache_key, __METHOD__);
         Yii::$app->cache->delete($cache_key);
     }
     return $ret;
 }