src/Resources/DynamoDbTable.php
protected function rollbackTransaction()
    {
        if (!empty($this->rollbackRecords)) {
            switch ($this->getAction()) {
                case Verbs::POST:
                    $requests = [];
                    foreach ($this->rollbackRecords as $item) {
                        $requests[] = ['DeleteRequest' => ['Key' => $item]];
                    }

                    /* $result = */
                    $this->getConnection()->batchWriteItem(
                        ['RequestItems' => [$this->transactionTable => $requests]]
                    );

                    // todo check $result['UnprocessedItems'] for 'DeleteRequest'
                    break;

                case Verbs::PUT:
                case Verbs::PATCH:
                case Verbs::DELETE:
                    $requests = [];
                    foreach ($this->rollbackRecords as $item) {
                        $requests[] = ['PutRequest' => ['Item' => $item]];
                    }

                    /* $result = */
                    $this->getConnection()->batchWriteItem(
                        ['RequestItems' => [$this->transactionTable => $requests]]
                    );

                    // todo check $result['UnprocessedItems'] for 'PutRequest'
                    break;

                default:
                    break;
            }

            $this->rollbackRecords = [];
        }

        return true;
    }
protected function rollbackTransaction()
    {
        if (!empty($this->rollbackRecords)) {
            switch ($this->getAction()) {
                case Verbs::POST:
                    $requests = [];
                    foreach ($this->rollbackRecords as $item) {
                        $requests[] = ['DeleteRequest' => ['Key' => $item]];
                    }

                    /* $result = */
                    $this->getConnection()->batchWriteItem(
                        ['RequestItems' => [$this->transactionTable => $requests]]
                    );

                    // todo check $result['UnprocessedItems'] for 'DeleteRequest'
                    break;

                case Verbs::PUT:
                case Verbs::PATCH:
                case Verbs::DELETE:
                    $requests = [];
                    foreach ($this->rollbackRecords as $item) {
                        $requests[] = ['PutRequest' => ['Item' => $item]];
                    }

                    /* $result = */
                    $this->getConnection()->batchWriteItem(
                        ['RequestItems' => [$this->transactionTable => $requests]]
                    );

                    // todo check $result['UnprocessedItems'] for 'PutRequest'
                    break;

                default:
                    break;
            }

            $this->rollbackRecords = [];
        }

        return true;
    }
{@inheritdoc}