summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Mapping/ToManyAssociationMappingImplementation.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2026-10-18 00:08:23 +0200
committerpolo <ordipolo@gmx.fr>2026-10-18 00:10:03 +0200
commit05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch)
treecf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/doctrine/orm/src/Mapping/ToManyAssociationMappingImplementation.php
parent32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff)
downloadAppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz
AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2
AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/doctrine/orm/src/Mapping/ToManyAssociationMappingImplementation.php')
-rw-r--r--vendor/doctrine/orm/src/Mapping/ToManyAssociationMappingImplementation.php69
1 files changed, 0 insertions, 69 deletions
diff --git a/vendor/doctrine/orm/src/Mapping/ToManyAssociationMappingImplementation.php b/vendor/doctrine/orm/src/Mapping/ToManyAssociationMappingImplementation.php
deleted file mode 100644
index 306880d..0000000
--- a/vendor/doctrine/orm/src/Mapping/ToManyAssociationMappingImplementation.php
+++ /dev/null
@@ -1,69 +0,0 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Mapping;
6
7use LogicException;
8
9use function sprintf;
10
11/** @internal */
12trait ToManyAssociationMappingImplementation
13{
14 /**
15 * Specification of a field on target-entity that is used to index the
16 * collection by. This field HAS to be either the primary key or a unique
17 * column. Otherwise the collection does not contain all the entities that
18 * are actually related.
19 */
20 public string|null $indexBy = null;
21
22 /**
23 * A map of field names (of the target entity) to sorting directions
24 *
25 * @var array<string, 'asc'|'desc'>
26 */
27 public array $orderBy = [];
28
29 /** @return array<string, 'asc'|'desc'> */
30 final public function orderBy(): array
31 {
32 return $this->orderBy;
33 }
34
35 /** @psalm-assert-if-true !null $this->indexBy */
36 final public function isIndexed(): bool
37 {
38 return $this->indexBy !== null;
39 }
40
41 final public function indexBy(): string
42 {
43 if (! $this->isIndexed()) {
44 throw new LogicException(sprintf(
45 'This mapping is not indexed. Use %s::isIndexed() to check that before calling %s.',
46 self::class,
47 __METHOD__,
48 ));
49 }
50
51 return $this->indexBy;
52 }
53
54 /** @return list<string> */
55 public function __sleep(): array
56 {
57 $serialized = parent::__sleep();
58
59 if ($this->indexBy !== null) {
60 $serialized[] = 'indexBy';
61 }
62
63 if ($this->orderBy !== []) {
64 $serialized[] = 'orderBy';
65 }
66
67 return $serialized;
68 }
69}