@@ 85-109 (lines=25) @@ | ||
82 | /** |
|
83 | * @inheritdoc |
|
84 | */ |
|
85 | public static function create( |
|
86 | array $routeParams, |
|
87 | ContainerInterface $container, |
|
88 | ServerRequestInterface $request |
|
89 | ): ResponseInterface { |
|
90 | static::assertClassValueDefined(static::API_CLASS); |
|
91 | static::assertClassValueDefined(static::SCHEMA_CLASS); |
|
92 | static::assertClassValueDefined(static::ON_CREATE_DATA_VALIDATION_RULES_CLASS); |
|
93 | ||
94 | $response = static::defaultCreateHandler( |
|
95 | $request->getUri(), |
|
96 | $request->getBody(), |
|
97 | static::SCHEMA_CLASS, |
|
98 | $container->get(ModelSchemaInfoInterface::class), |
|
99 | static::defaultCreateDataParser($container, static::ON_CREATE_DATA_VALIDATION_RULES_CLASS), |
|
100 | static::defaultCreateApi($container, static::API_CLASS), |
|
101 | $container->get(SettingsProviderInterface::class), |
|
102 | $container->get(JsonSchemasInterface::class), |
|
103 | $container->get(EncoderInterface::class), |
|
104 | $container->get(FactoryInterface::class), |
|
105 | $container->get(FormatterFactoryInterface::class) |
|
106 | ); |
|
107 | ||
108 | return $response; |
|
109 | } |
|
110 | ||
111 | /** |
|
112 | * @inheritdoc |
|
@@ 139-164 (lines=26) @@ | ||
136 | /** |
|
137 | * @inheritdoc |
|
138 | */ |
|
139 | public static function update( |
|
140 | array $routeParams, |
|
141 | ContainerInterface $container, |
|
142 | ServerRequestInterface $request |
|
143 | ): ResponseInterface { |
|
144 | static::assertClassValueDefined(static::API_CLASS); |
|
145 | static::assertClassValueDefined(static::SCHEMA_CLASS); |
|
146 | static::assertClassValueDefined(static::ON_UPDATE_DATA_VALIDATION_RULES_CLASS); |
|
147 | ||
148 | $response = static::defaultUpdateHandler( |
|
149 | $routeParams[static::ROUTE_KEY_INDEX], |
|
150 | $request->getUri(), |
|
151 | $request->getBody(), |
|
152 | static::SCHEMA_CLASS, |
|
153 | $container->get(ModelSchemaInfoInterface::class), |
|
154 | static::defaultCreateDataParser($container, static::ON_UPDATE_DATA_VALIDATION_RULES_CLASS), |
|
155 | static::defaultCreateApi($container, static::API_CLASS), |
|
156 | $container->get(SettingsProviderInterface::class), |
|
157 | $container->get(JsonSchemasInterface::class), |
|
158 | $container->get(EncoderInterface::class), |
|
159 | $container->get(FactoryInterface::class), |
|
160 | $container->get(FormatterFactoryInterface::class) |
|
161 | ); |
|
162 | ||
163 | return $response; |
|
164 | } |
|
165 | ||
166 | /** |
|
167 | * @inheritdoc |