abstract class AbstractSerializer extends AbstractSerializer
Properties
protected | $request | |||
protected | $actor | |||
static protected | $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(object|array $model, string $name)
<p>Get a custom relationship.</p>
Relationship|null
hasOne(object|array $model, SerializerInterface|Closure|string $serializer, string $relation = null)
<p>Get a relationship builder for a has-one relationship.</p>
Relationship|null
hasMany(object|array $model, SerializerInterface|Closure|string $serializer, string $relation = null)
<p>Get a relationship builder for a has-many relationship.</p>
Relationship|null
buildRelationship(object|array $model, SerializerInterface|Closure|string $serializer, string $relation = null, bool $many = false)
No description
SerializerInterface
resolveSerializer(SerializerInterface|Closure|string $serializer, object|array $model, mixed $data)
No description
static void
setRelationship(string $serializerClass, string $relation, callable $callback)
No description
Details
at
line 43
ServerRequestInterface
getRequest()
at
line 48
void
setRequest(ServerRequestInterface $request)
at
line 59
array
getAttributes(mixed $model, array $fields = null)
at
line 84
abstract protected array
getDefaultAttributes(object|array $model)
<p>Get the default set of serialized attributes for a model.</p>
at
line 91
getRelationship($model, $name)
at
line 103
protected Relationship|null
getCustomRelationship(object|array $model, string $name)
<p>Get a custom relationship.</p>
at
line 127
Relationship|null
hasOne(object|array $model, SerializerInterface|Closure|string $serializer, string $relation = null)
<p>Get a relationship builder for a has-one relationship.</p>
at
line 135
Relationship|null
hasMany(object|array $model, SerializerInterface|Closure|string $serializer, string $relation = null)
<p>Get a relationship builder for a has-many relationship.</p>