diff options
author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/orm/src/Mapping/AssociationOverride.php | |
parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/orm/src/Mapping/AssociationOverride.php')
-rw-r--r-- | vendor/doctrine/orm/src/Mapping/AssociationOverride.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Mapping/AssociationOverride.php b/vendor/doctrine/orm/src/Mapping/AssociationOverride.php new file mode 100644 index 0000000..e0ebc07 --- /dev/null +++ b/vendor/doctrine/orm/src/Mapping/AssociationOverride.php | |||
@@ -0,0 +1,51 @@ | |||
1 | <?php | ||
2 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\ORM\Mapping; | ||
6 | |||
7 | /** This attribute is used to override association mapping of property for an entity relationship. */ | ||
8 | final class AssociationOverride implements MappingAttribute | ||
9 | { | ||
10 | /** | ||
11 | * The join column that is being mapped to the persistent attribute. | ||
12 | * | ||
13 | * @var array<JoinColumn>|null | ||
14 | */ | ||
15 | public readonly array|null $joinColumns; | ||
16 | |||
17 | /** | ||
18 | * The join column that is being mapped to the persistent attribute. | ||
19 | * | ||
20 | * @var array<JoinColumn>|null | ||
21 | */ | ||
22 | public readonly array|null $inverseJoinColumns; | ||
23 | |||
24 | /** | ||
25 | * @param string $name The name of the relationship property whose mapping is being overridden. | ||
26 | * @param JoinColumn|array<JoinColumn> $joinColumns | ||
27 | * @param JoinColumn|array<JoinColumn> $inverseJoinColumns | ||
28 | * @param JoinTable|null $joinTable The join table that maps the relationship. | ||
29 | * @param string|null $inversedBy The name of the association-field on the inverse-side. | ||
30 | * @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY'|null $fetch | ||
31 | */ | ||
32 | public function __construct( | ||
33 | public readonly string $name, | ||
34 | array|JoinColumn|null $joinColumns = null, | ||
35 | array|JoinColumn|null $inverseJoinColumns = null, | ||
36 | public readonly JoinTable|null $joinTable = null, | ||
37 | public readonly string|null $inversedBy = null, | ||
38 | public readonly string|null $fetch = null, | ||
39 | ) { | ||
40 | if ($joinColumns instanceof JoinColumn) { | ||
41 | $joinColumns = [$joinColumns]; | ||
42 | } | ||
43 | |||
44 | if ($inverseJoinColumns instanceof JoinColumn) { | ||
45 | $inverseJoinColumns = [$inverseJoinColumns]; | ||
46 | } | ||
47 | |||
48 | $this->joinColumns = $joinColumns; | ||
49 | $this->inverseJoinColumns = $inverseJoinColumns; | ||
50 | } | ||
51 | } | ||