Skip to content

Commit

Permalink
added EVENT_DOCUMENT_PURGE on purgeCachedDocument method
Browse files Browse the repository at this point in the history
  • Loading branch information
shimonewman committed Jan 21, 2025
1 parent 240478a commit 1b2f51c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class Database

public const EVENT_DOCUMENT_FIND = 'document_find';
public const EVENT_DOCUMENT_CREATE = 'document_create';
public const EVENT_DOCUMENT_PURGE = 'document_purge';
public const EVENT_DOCUMENTS_CREATE = 'documents_create';
public const EVENT_DOCUMENTS_DELETE = 'documents_delete';
public const EVENT_DOCUMENT_READ = 'document_read';
Expand Down Expand Up @@ -5331,6 +5332,11 @@ public function purgeCachedDocument(string $collectionId, string $id): bool
$this->cache->purge($collectionKey, $documentKey);
$this->cache->purge($documentKey);

$this->trigger(self::EVENT_DOCUMENT_PURGE, [
'id' => $id,
'collectionId' => $collectionId
]);

return true;
}

Expand Down

0 comments on commit 1b2f51c

Please sign in to comment.