@@ 96-107 (lines=12) @@ | ||
93 | * |
|
94 | * @return NormalizationFieldMappingBuilderInterface |
|
95 | */ |
|
96 | public static function createReferenceMany( |
|
97 | string $name, |
|
98 | string $idName = 'id' |
|
99 | ): NormalizationFieldMappingBuilderInterface { |
|
100 | $self = new self($name); |
|
101 | $self->fieldNormalizer = new ReferenceManyFieldNormalizer( |
|
102 | new PropertyAccessor($idName), |
|
103 | new PropertyAccessor($name) |
|
104 | ); |
|
105 | ||
106 | return $self; |
|
107 | } |
|
108 | ||
109 | /** |
|
110 | * @param string $name |
|
@@ 115-126 (lines=12) @@ | ||
112 | * |
|
113 | * @return NormalizationFieldMappingBuilderInterface |
|
114 | */ |
|
115 | public static function createReferenceOne( |
|
116 | string $name, |
|
117 | string $idName = 'id' |
|
118 | ): NormalizationFieldMappingBuilderInterface { |
|
119 | $self = new self($name); |
|
120 | $self->fieldNormalizer = new ReferenceOneFieldNormalizer( |
|
121 | new PropertyAccessor($idName), |
|
122 | new PropertyAccessor($name) |
|
123 | ); |
|
124 | ||
125 | return $self; |
|
126 | } |
|
127 | ||
128 | /** |
|
129 | * @param array $groups |