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