yii\db\Command::delete PHP Method

delete() public method

For example, php $connection->createCommand()->delete('user', 'status = 0')->execute(); The method will properly escape the table and column names. Note that the created command is not executed until Command::execute is called.
public delete ( string $table, string | array $condition = '', array $params = [] )
$table string the table where the data will be deleted from.
$condition string | array the condition that will be put in the WHERE part. Please refer to [[Query::where()]] on how to specify condition.
$params array the parameters to be bound to the command
    public function delete($table, $condition = '', $params = [])
    {
        $sql = $this->db->getQueryBuilder()->delete($table, $condition, $params);
        return $this->setSql($sql)->bindValues($params);
    }