@@ 112-123 (lines=12) @@ | ||
109 | * |
|
110 | * @return NormalizationFieldMappingBuilderInterface |
|
111 | */ |
|
112 | public static function createReferenceMany( |
|
113 | string $name, |
|
114 | string $idName = 'id' |
|
115 | ): NormalizationFieldMappingBuilderInterface { |
|
116 | $self = new self($name); |
|
117 | $self->fieldNormalizer = new ReferenceManyFieldNormalizer( |
|
118 | new PropertyAccessor($idName), |
|
119 | new PropertyAccessor($name) |
|
120 | ); |
|
121 | ||
122 | return $self; |
|
123 | } |
|
124 | ||
125 | /** |
|
126 | * @param string $name |
|
@@ 131-142 (lines=12) @@ | ||
128 | * |
|
129 | * @return NormalizationFieldMappingBuilderInterface |
|
130 | */ |
|
131 | public static function createReferenceOne( |
|
132 | string $name, |
|
133 | string $idName = 'id' |
|
134 | ): NormalizationFieldMappingBuilderInterface { |
|
135 | $self = new self($name); |
|
136 | $self->fieldNormalizer = new ReferenceOneFieldNormalizer( |
|
137 | new PropertyAccessor($idName), |
|
138 | new PropertyAccessor($name) |
|
139 | ); |
|
140 | ||
141 | return $self; |
|
142 | } |
|
143 | ||
144 | /** |
|
145 | * @param array $groups |