/** * MATRIX based, for supporting the grid-view editor * * @param Request $request * @param Response $response * @return int */ public function schemaSavePOST(Request $request, Response $response) { $this->logger->info(__CLASS__ . '::' . __FUNCTION__); $parsed = $request->getParsedBody(); $this->logger->info(__CLASS__ . '::' . __FUNCTION__ . ': $parsed: ' . json_encode($parsed, JSON_UNESCAPED_SLASHES)); $schema_id = $parsed['schema_id']; $title = $parsed['title']; $description = $parsed['description']; $mimeType = $parsed['mimeType']; $matrix = $parsed['matrix']; $service = new SchemaService(); $this->logger->info(__CLASS__ . '::' . __FUNCTION__ . ': calling service->storeSchema: ' . $schema_id . ', ' . $mimeType . ', ' . $description); $resp = $service->storeSchema($schema_id, $mimeType, $description, $title, $matrix); $this->logger->info(__CLASS__ . '::' . __FUNCTION__ . ': $resp: ' . json_encode($resp, JSON_UNESCAPED_SLASHES)); return $response->getBody()->write(json_encode($resp, JSON_UNESCAPED_SLASHES)); }