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