src/Controller/Api/CaseV1P0Controller.php
/**
     * Generate a response for a single object.
     */
Generate a response for a single object.
Generate a response for a single object .
protected function generateObjectResponse(Request $request, CaseApiInterface $obj): Response
    {
        $this->info('CASE API: Returned object', ['type' => get_class($obj), 'id' => $obj->getIdentifier()]);
        $response = $this->generateBaseResponse($obj->getUpdatedAt());
        if ($response->isNotModified($request)) {
            return $response;
        }
        $serializationGroups = [
            'Default',
            preg_replace('/.*\\\\/', '', get_class($obj)),
        ];
        $serializationContext = $this->createSerializationContext($request, $serializationGroups);
        $result = $this->serializer->serialize(
            $obj,
            $request->getRequestFormat('json'),
            $serializationContext
        );
        $response->setContent($result);
        return $response;
    }
protected function generateObjectResponse ( Request $ request , CaseApiInterface $ obj ) : Response { $ this -> info ( 'CASE API: Returned object' , [ 'type' => get_class ( $ obj ) , 'id' => $ obj -> getIdentifier ( ) ] ) ; $ response = $ this -> generateBaseResponse ( $ obj -> getUpdatedAt ( ) ) ; if ( $ response -> isNotModified ( $ request ) ) { return $ response ; } $ serializationGroups = [ 'Default' , preg_replace ( '/.*\\\\/' , '' , get_class ( $ obj ) ) , ] ; $ serializationContext = $ this -> createSerializationContext ( $ request , $ serializationGroups ) ; $ result = $ this -> serializer -> serialize ( $ obj , $ request -> getRequestFormat ( 'json' ) , $ serializationContext ) ; $ response -> setContent ( $ result ) ; return $ response ; }
Generate a response for a single object.
Generate a response for a single object .