summaryrefslogtreecommitdiff
path: root/vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadata.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadata.php')
-rw-r--r--vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadata.php141
1 files changed, 141 insertions, 0 deletions
diff --git a/vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadata.php b/vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadata.php
new file mode 100644
index 0000000..f407ba3
--- /dev/null
+++ b/vendor/doctrine/persistence/src/Persistence/Mapping/ClassMetadata.php
@@ -0,0 +1,141 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\Persistence\Mapping;
6
7use ReflectionClass;
8
9/**
10 * Contract for a Doctrine persistence layer ClassMetadata class to implement.
11 *
12 * @template-covariant T of object
13 */
14interface ClassMetadata
15{
16 /**
17 * Gets the fully-qualified class name of this persistent class.
18 *
19 * @return string
20 * @psalm-return class-string<T>
21 */
22 public function getName();
23
24 /**
25 * Gets the mapped identifier field name.
26 *
27 * The returned structure is an array of the identifier field names.
28 *
29 * @return array<int, string>
30 * @psalm-return list<string>
31 */
32 public function getIdentifier();
33
34 /**
35 * Gets the ReflectionClass instance for this mapped class.
36 *
37 * @return ReflectionClass<T>
38 */
39 public function getReflectionClass();
40
41 /**
42 * Checks if the given field name is a mapped identifier for this class.
43 *
44 * @return bool
45 */
46 public function isIdentifier(string $fieldName);
47
48 /**
49 * Checks if the given field is a mapped property for this class.
50 *
51 * @return bool
52 */
53 public function hasField(string $fieldName);
54
55 /**
56 * Checks if the given field is a mapped association for this class.
57 *
58 * @return bool
59 */
60 public function hasAssociation(string $fieldName);
61
62 /**
63 * Checks if the given field is a mapped single valued association for this class.
64 *
65 * @return bool
66 */
67 public function isSingleValuedAssociation(string $fieldName);
68
69 /**
70 * Checks if the given field is a mapped collection valued association for this class.
71 *
72 * @return bool
73 */
74 public function isCollectionValuedAssociation(string $fieldName);
75
76 /**
77 * A numerically indexed list of field names of this persistent class.
78 *
79 * This array includes identifier fields if present on this class.
80 *
81 * @return array<int, string>
82 */
83 public function getFieldNames();
84
85 /**
86 * Returns an array of identifier field names numerically indexed.
87 *
88 * @return array<int, string>
89 */
90 public function getIdentifierFieldNames();
91
92 /**
93 * Returns a numerically indexed list of association names of this persistent class.
94 *
95 * This array includes identifier associations if present on this class.
96 *
97 * @return array<int, string>
98 */
99 public function getAssociationNames();
100
101 /**
102 * Returns a type name of this field.
103 *
104 * This type names can be implementation specific but should at least include the php types:
105 * integer, string, boolean, float/double, datetime.
106 *
107 * @return string|null
108 */
109 public function getTypeOfField(string $fieldName);
110
111 /**
112 * Returns the target class name of the given association.
113 *
114 * @return string|null
115 * @psalm-return class-string|null
116 */
117 public function getAssociationTargetClass(string $assocName);
118
119 /**
120 * Checks if the association is the inverse side of a bidirectional association.
121 *
122 * @return bool
123 */
124 public function isAssociationInverseSide(string $assocName);
125
126 /**
127 * Returns the target field of the owning side of the association.
128 *
129 * @return string
130 */
131 public function getAssociationMappedByTargetField(string $assocName);
132
133 /**
134 * Returns the identifier of this object as an array with field name as key.
135 *
136 * Has to return an empty array if no identifier isset.
137 *
138 * @return array<string, mixed>
139 */
140 public function getIdentifierValues(object $object);
141}