public function delete($document)
    {
        $qb         = $this->dm->createQueryBuilder($this->class->name);
        $identifier = $this->uow->getDocumentIdentifier($document);

        $qb->delete();
        $qb->setIdentifier($identifier);

        if ($this->class->isLockable) {
            $qb->attr($this->class->lockMetadata->name)->exists(false);
        }

        try {
            $qb->getQuery()->execute();
        } catch (\Aws\DynamoDb\Exception\DynamoDbException $e) {
            if (
                ($this->class->isVersioned || $this->class->isLockable) &&
                $e->getAwsErrorCode() === 'ConditionalCheckFailedException'
            ) {
                throw LockException::lockFailed($document);
            }

            throw $e;
        }
    }
public function delete($document)
    {
        $qb         = $this->dm->createQueryBuilder($this->class->name);
        $identifier = $this->uow->getDocumentIdentifier($document);

        $qb->delete();
        $qb->setIdentifier($identifier);

        if ($this->class->isLockable) {
            $qb->attr($this->class->lockMetadata->name)->exists(false);
        }

        try {
            $qb->getQuery()->execute();
        } catch (\Aws\DynamoDb\Exception\DynamoDbException $e) {
            if (
                ($this->class->isVersioned || $this->class->isLockable) &&
                $e->getAwsErrorCode() === 'ConditionalCheckFailedException'
            ) {
                throw LockException::lockFailed($document);
            }

            throw $e;
        }
    }
public function delete ( $ document ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; $ identifier = $ this -> uow -> getDocumentIdentifier ( $ document ) ; $ qb -> delete ( ) ; $ qb -> setIdentifier ( $ identifier ) ; if ( $ this -> class -> isLockable ) { $ qb -> attr ( $ this -> class -> lockMetadata -> name ) -> exists ( false ) ; } try { $ qb -> getQuery ( ) -> execute ( ) ; } catch ( \ Aws \ DynamoDb \ Exception \ DynamoDbException $ e ) { if ( ( $ this -> class -> isVersioned || $ this -> class -> isLockable ) && $ e -> getAwsErrorCode ( ) === 'ConditionalCheckFailedException' ) { throw LockException :: lockFailed ( $ document ) ; } throw $ e ; } }
Removes a document from DynamoDB

@param object $document

@return void

@throws LockException
Removes a document from DynamoDB