abstract class AbstractSerializer extends AbstractSerializer
Properties
protected ServerRequestInterface | $request | |||
protected User | $actor | |||
static protected Container | $container | |||
static protected array<string,callable[]> | $attributeMutators | |||
static protected array<string,array<string,callable>> | $customRelations |
Methods
array
getDefaultAttributes(object|array $model)
<p>Get the default set of serialized attributes for a model.</p>
Relationship|null
getCustomRelationship(mixed $model, string $name)
<p>Get a custom relationship.</p>
Relationship
Relationship
Relationship|null
buildRelationship(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null, bool $many = false)
No description
static void
setRelationship(string $serializerClass, string $relation, callable $callback)
No description
Details
at
line 57
ServerRequestInterface
getRequest()
at
line 65
setRequest(ServerRequestInterface $request)
at
line 82
getAttributes($model, array $fields = null)
<p>{@inheritdoc}</p>
at
line 110
abstract protected array
getDefaultAttributes(object|array $model)
<p>Get the default set of serialized attributes for a model.</p>
at
line 126
getRelationship($model, $name)
<p>{@inheritdoc}</p>
at
line 142
protected Relationship|null
getCustomRelationship(mixed $model, string $name)
<p>Get a custom relationship.</p>
at
line 169
Relationship
hasOne(mixed $model, string|Closure|SerializerInterface $serializer, string|Closure|null $relation = null)
<p>Get a relationship builder for a has-one relationship.</p>
at
line 182
Relationship
hasMany(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null)
<p>Get a relationship builder for a has-many relationship.</p>