class ForumSerializer 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 Config | $config | |||
protected SettingsRepositoryInterface | $settings | |||
protected UrlGenerator | $url | |||
protected Cloud | $assetsFilesystem |
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>
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
__construct(Config $config, Factory $filesystemFactory, SettingsRepositoryInterface $settings, UrlGenerator $url)
No description
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 71
protected array
getDefaultAttributes(object|array $model)
<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>
in AbstractSerializer
at
line 194
protected Relationship
buildRelationship(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null, bool $many = false)
in AbstractSerializer
at
line 220
protected mixed
getRelationshipData(mixed $model, string $relation)
in AbstractSerializer
at
line 236
protected SerializerInterface
resolveSerializer(mixed $serializer, mixed $model, mixed $data)
in AbstractSerializer
at
line 258
protected object
resolveSerializerClass(string $class)
in AbstractSerializer
at
line 270
static Container
getContainer()
in AbstractSerializer
at
line 280
static
setContainer(Container $container)
in AbstractSerializer
at
line 291
static void
addAttributeMutator(string $serializerClass, callable $callback)
in AbstractSerializer
at
line 307
static void
setRelationship(string $serializerClass, string $relation, callable $callback)
at
line 52
__construct(Config $config, Factory $filesystemFactory, SettingsRepositoryInterface $settings, UrlGenerator $url)
at
line 63
getId($model)
<p>{@inheritdoc}</p>