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