class BasicDiscussionSerializer extends AbstractSerializer
Properties
protected ServerRequestInterface | $request | from AbstractSerializer | ||
protected User | $actor | from AbstractSerializer | ||
static protected Container | $container | from AbstractSerializer | ||
static protected callable[] | $attributeMutators | from AbstractSerializer | ||
static protected array | $customRelations | from AbstractSerializer | ||
protected | $type | <p>{@inheritdoc}</p> | ||
protected SlugManager | $slugManager |
Methods
array
getDefaultAttributes(Discussion $discussion)
<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>
from AbstractSerializer
Relationship
hasOne(mixed $model, string|Closure|SerializerInterface $serializer, string|Closure|null $relation = null)
<p>Get a relationship builder for a has-one relationship.</p>
from AbstractSerializer
Relationship
hasMany(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null)
<p>Get a relationship builder for a has-many relationship.</p>
from AbstractSerializer
Relationship
buildRelationship(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null, bool $many = false)
No description
from AbstractSerializer
SerializerInterface
resolveSerializer(mixed $serializer, mixed $model, mixed $data)
No description
from AbstractSerializer
static void
addAttributeMutator(string $serializerClass, callable $callback)
No description
from AbstractSerializer
static void
setRelationship(string $serializerClass, string $relation, callable $callback)
No description
from AbstractSerializer
Details
in AbstractSerializer
at
line 57
ServerRequestInterface
getRequest()
in AbstractSerializer
at
line 65
setRequest(ServerRequestInterface $request)
in AbstractSerializer
at
line 74
User
getActor()
in AbstractSerializer
at
line 82
getAttributes($model, array $fields = null)
<p>{@inheritdoc}</p>
at
line 39
protected array
getDefaultAttributes(Discussion $discussion)
<p>Get the default set of serialized attributes for a model.</p>
in AbstractSerializer
at
line 116
string|null
formatDate(DateTime $date = null)
in AbstractSerializer
at
line 126
getRelationship($model, $name)
<p>{@inheritdoc}</p>
in AbstractSerializer
at
line 142
protected Relationship|null
getCustomRelationship(mixed $model, string $name)
<p>Get a custom relationship.</p>
in AbstractSerializer
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>
in AbstractSerializer
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>