29
29
*/
30
30
class MappingException extends BaseMappingException
31
31
{
32
+ /**
33
+ * @param string $name
34
+ * @return MappingException
35
+ */
32
36
public static function typeExists ($ name )
33
37
{
34
38
return new self ('Type ' . $ name . ' already exists. ' );
35
39
}
36
40
41
+ /**
42
+ * @param string $name
43
+ * @return MappingException
44
+ */
37
45
public static function typeNotFound ($ name )
38
46
{
39
47
return new self ('Type to be overwritten ' . $ name . ' does not exist. ' );
40
48
}
41
49
50
+ /**
51
+ * @param string $className
52
+ * @param string $fieldName
53
+ * @return MappingException
54
+ */
42
55
public static function mappingNotFound ($ className , $ fieldName )
43
56
{
44
57
return new self ("No mapping found for field ' $ fieldName' in class ' $ className'. " );
45
58
}
46
59
60
+ /**
61
+ * @param string $document
62
+ * @param string $fieldName
63
+ * @return MappingException
64
+ */
47
65
public static function duplicateFieldMapping ($ document , $ fieldName )
48
66
{
49
67
return new self ('Property " ' . $ fieldName . '" in " ' . $ document . '" was already declared, but it must be declared only once ' );
50
68
}
51
69
70
+ /**
71
+ * @param string $document
72
+ * @param string $fieldName
73
+ * @return MappingException
74
+ */
52
75
public static function discriminatorFieldConflict ($ document , $ fieldName )
53
76
{
54
77
return new self ('Discriminator field " ' . $ fieldName . '" in " ' . $ document . '" conflicts with a mapped field \'s "name" attribute. ' );
@@ -60,7 +83,7 @@ public static function discriminatorFieldConflict($document, $fieldName)
60
83
*
61
84
* @param string $className The class that could not be found
62
85
* @param string $owningClass The class that declares the discriminator map.
63
- * @return self
86
+ * @return MappingException
64
87
*/
65
88
public static function invalidClassInDiscriminatorMap ($ className , $ owningClass )
66
89
{
@@ -75,18 +98,26 @@ public static function invalidClassInDiscriminatorMap($className, $owningClass)
75
98
*
76
99
* @param string $value The discriminator value that could not be found
77
100
* @param string $owningClass The class that declares the discriminator map
78
- * @return self
101
+ * @return MappingException
79
102
*/
80
103
public static function invalidDiscriminatorValue ($ value , $ owningClass )
81
104
{
82
105
return new self ("Discriminator value ' $ value' used in the declaration of class ' $ owningClass' does not exist. " );
83
106
}
84
107
108
+ /**
109
+ * @param string $className
110
+ * @return MappingException
111
+ */
85
112
public static function missingFieldName ($ className )
86
113
{
87
114
return new self ("The Document class ' $ className' field mapping misses the 'fieldName' attribute. " );
88
115
}
89
116
117
+ /**
118
+ * @param string $className
119
+ * @return MappingException
120
+ */
90
121
public static function classIsNotAValidDocument ($ className )
91
122
{
92
123
return new self ('Class ' . $ className . ' is not a valid document or mapped super class. ' );
0 commit comments