summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Persisters/Collection/CollectionPersister.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/orm/src/Persisters/Collection/CollectionPersister.php')
-rw-r--r--vendor/doctrine/orm/src/Persisters/Collection/CollectionPersister.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Persisters/Collection/CollectionPersister.php b/vendor/doctrine/orm/src/Persisters/Collection/CollectionPersister.php
new file mode 100644
index 0000000..07c4eaf
--- /dev/null
+++ b/vendor/doctrine/orm/src/Persisters/Collection/CollectionPersister.php
@@ -0,0 +1,59 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Persisters\Collection;
6
7use Doctrine\Common\Collections\Criteria;
8use Doctrine\ORM\PersistentCollection;
9
10/**
11 * Define the behavior that should be implemented by all collection persisters.
12 */
13interface CollectionPersister
14{
15 /**
16 * Deletes the persistent state represented by the given collection.
17 */
18 public function delete(PersistentCollection $collection): void;
19
20 /**
21 * Updates the given collection, synchronizing its state with the database
22 * by inserting, updating and deleting individual elements.
23 */
24 public function update(PersistentCollection $collection): void;
25
26 /**
27 * Counts the size of this persistent collection.
28 */
29 public function count(PersistentCollection $collection): int;
30
31 /**
32 * Slices elements.
33 *
34 * @return mixed[]
35 */
36 public function slice(PersistentCollection $collection, int $offset, int|null $length = null): array;
37
38 /**
39 * Checks for existence of an element.
40 */
41 public function contains(PersistentCollection $collection, object $element): bool;
42
43 /**
44 * Checks for existence of a key.
45 */
46 public function containsKey(PersistentCollection $collection, mixed $key): bool;
47
48 /**
49 * Gets an element by key.
50 */
51 public function get(PersistentCollection $collection, mixed $index): mixed;
52
53 /**
54 * Loads association entities matching the given Criteria object.
55 *
56 * @return mixed[]
57 */
58 public function loadCriteria(PersistentCollection $collection, Criteria $criteria): array;
59}