Imbo\Database\MongoDB::deleteShortUrls PHP Method

deleteShortUrls() public method

public deleteShortUrls ( $user, $imageIdentifier, $shortUrlId = null )
    public function deleteShortUrls($user, $imageIdentifier, $shortUrlId = null)
    {
        $query = ['user' => $user, 'imageIdentifier' => $imageIdentifier];
        if ($shortUrlId) {
            $query['shortUrlId'] = $shortUrlId;
        }
        try {
            $this->getShortUrlCollection()->remove($query);
        } catch (MongoException $e) {
            throw new DatabaseException('Unable to delete short URLs', 500, $e);
        }
        return true;
    }