ResponseCreator
Table of Contents
-
RESPONSE_ERROR
= 'Request error'
-
RESPONSE_SUCCESS
= 'Success'
-
$arrayTransformer
: ArrayTransformerInterface
-
$data
: mixed
-
$errors
: array<string|int, Error>
-
$exceptionTransformer
: ExceptionTransformer
-
$formErrorsTransformer
: FormErrorsTransformer
-
$serializer
: SerializerInterface
-
createError()
: JsonResponse
-
createSuccess()
: JsonResponse
-
data()
: mixed
-
errors()
: array<string|int, mixed>
-
fromArray()
: mixed
-
fromException()
: JsonResponse
-
serializerCreate()
: Serializer
-
setSerializerContext()
: SerializationContext
-
toArray()
: array<string|int, mixed>
RESPONSE_ERROR
public
mixed
RESPONSE_ERROR
= 'Request error'
RESPONSE_SUCCESS
public
mixed
RESPONSE_SUCCESS
= 'Success'
private
ArrayTransformerInterface
$arrayTransformer
$data
private
mixed
$data
$errors
private
array<string|int, Error>
$errors
private
ExceptionTransformer
$exceptionTransformer
private
FormErrorsTransformer
$formErrorsTransformer
$serializer
private
SerializerInterface
$serializer
createError()
public
createError(mixed $errors[, int $code = Response::HTTP_OK ]) : JsonResponse
Parameters
-
$errors
: mixed
-
-
$code
: int
= Response::HTTP_OK
-
Return values
JsonResponse
—
createSuccess()
public
createSuccess([mixed $data = null ][, int $code = Response::HTTP_OK ]) : JsonResponse
Parameters
-
$data
: mixed
= null
-
-
$code
: int
= Response::HTTP_OK
-
Return values
JsonResponse
—
data()
public
data() : mixed
Return values
mixed
—
errors()
public
errors() : array<string|int, mixed>
Return values
array<string|int, mixed>
—
fromArray()
public
fromArray(array<string|int, mixed> $data, string $type[, DeserializationContext|null $context = null ]) : mixed
Parameters
-
$data
: array<string|int, mixed>
-
-
$type
: string
-
-
$context
: DeserializationContext|null
= null
-
Return values
mixed
—
fromException()
public
fromException(Exception $exception) : JsonResponse
Parameters
-
$exception
: Exception
-
Return values
JsonResponse
—
serializerCreate()
public
serializerCreate() : Serializer
Return values
Serializer
—
setSerializerContext()
public
setSerializerContext() : SerializationContext
Return values
SerializationContext
—
toArray()
public
toArray(mixed $data[, SerializationContext|null $context = null ][, string|null $type = null ]) : array<string|int, mixed>
Parameters
-
$data
: mixed
-
-
$context
: SerializationContext|null
= null
-
-
$type
: string|null
= null
-
Return values
array<string|int, mixed>
—