You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Deletes rows in the table using the provided conditions. * 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: * * ~~~ * Customer::deleteAll(['status' => 3]); * ~~~ * * @param array $condition the conditions that will be put in the WHERE part of the DELETE SQL. * Please refer to [[ActiveQuery::where()]] on how to specify this parameter. * @return int the number of rows deleted */publicstaticfunctiondeleteAll($condition = null)
{
$db = static::getDb();
$script = $db->getLuaScriptBuilder()->delete(static::class, $condition);
return$db->executeCommand('EVAL', [$script, 0]);
}
Additional info
Q
A
Yii vesion
2.0.40
PHP version
8.0.1
Operating system
docker
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
add Data
change primaryKey
deleteAll()
What's expected?
Expected the find()->all() is empty
but,calling find()->all() the data is still
What do you get instead?
Refactoring deleteAll()
\yii\redis\LuaScriptBuilder
\yii\redis\ActiveRecord
Additional info
The text was updated successfully, but these errors were encountered: