src/Resources/BaseDbTableResource.php
public function deleteRecordsByIds($table, $ids, $extras = [])
    {
        $ids = static::validateAsArray($ids, ',', true, 'The request contains no valid identifiers.');

        $fields = array_get($extras, ApiOptions::FIELDS);
        $idFields = array_get($extras, ApiOptions::ID_FIELD);
        $idTypes = array_get($extras, ApiOptions::ID_TYPE);
        $isSingle = (1 == count($ids));
        $rollback = array_get_bool($extras, ApiOptions::ROLLBACK);
        $continue = array_get_bool($extras, ApiOptions::CONTINUES);
        if ($rollback && $continue) {
            throw new BadRequestException('Rollback and continue operations can not be requested at the same time.');
        }

        $this->initTransaction($table, $idFields, $idTypes);

        $extras['id_fields'] = $idFields;
        $extras['require_more'] = static::requireMoreFields($fields, $idFields);

        $out = [];
        $errors = false;
        foreach ($ids as $index => $id) {
            try {
                if (false === $id = $this->checkForIds($id, $this->tableIdsInfo, $extras, true)) {
                    throw new BadRequestException("Required id field(s) not valid in request $index: " .
                        print_r($id, true));
                }

                $out[$index] = $this->addToTransaction(null, $id, $extras, $rollback, $continue, $isSingle);
            } catch (\Exception $ex) {
                $errors = true;
                $out[$index] = $ex;
                if ($rollback || !$continue) {
                    break;
                }
            }
        }

        if ($errors) {
            $msg = 'Batch Error: Not all requested records could be deleted.';

            if ($rollback) {
                $this->rollbackTransaction();
                $msg .= " All changes rolled back.";
            }

            throw new BatchException($out, $msg);
        }

        $result = $this->commitTransaction($extras);
        if (isset($result)) {
            $out = $result;
        }

        return $out;
    }
public function deleteRecordsByIds($table, $ids, $extras = [])
    {
        $ids = static::validateAsArray($ids, ',', true, 'The request contains no valid identifiers.');

        $fields = array_get($extras, ApiOptions::FIELDS);
        $idFields = array_get($extras, ApiOptions::ID_FIELD);
        $idTypes = array_get($extras, ApiOptions::ID_TYPE);
        $isSingle = (1 == count($ids));
        $rollback = array_get_bool($extras, ApiOptions::ROLLBACK);
        $continue = array_get_bool($extras, ApiOptions::CONTINUES);
        if ($rollback && $continue) {
            throw new BadRequestException('Rollback and continue operations can not be requested at the same time.');
        }

        $this->initTransaction($table, $idFields, $idTypes);

        $extras['id_fields'] = $idFields;
        $extras['require_more'] = static::requireMoreFields($fields, $idFields);

        $out = [];
        $errors = false;
        foreach ($ids as $index => $id) {
            try {
                if (false === $id = $this->checkForIds($id, $this->tableIdsInfo, $extras, true)) {
                    throw new BadRequestException("Required id field(s) not valid in request $index: " .
                        print_r($id, true));
                }

                $out[$index] = $this->addToTransaction(null, $id, $extras, $rollback, $continue, $isSingle);
            } catch (\Exception $ex) {
                $errors = true;
                $out[$index] = $ex;
                if ($rollback || !$continue) {
                    break;
                }
            }
        }

        if ($errors) {
            $msg = 'Batch Error: Not all requested records could be deleted.';

            if ($rollback) {
                $this->rollbackTransaction();
                $msg .= " All changes rolled back.";
            }

            throw new BatchException($out, $msg);
        }

        $result = $this->commitTransaction($extras);
        if (isset($result)) {
            $out = $result;
        }

        return $out;
    }
@param string $table
@param mixed  $ids - array or comma-delimited list of record identifiers
@param array  $extras

@throws \Exception
@return array