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