class ForumSerializer extends AbstractSerializer
Properties
protected ServerRequestInterface | $request | from AbstractSerializer | ||
protected User | $actor | from AbstractSerializer | ||
static protected Container | $container | from AbstractSerializer | ||
static protected array<string,callable[]> | $attributeMutators | from AbstractSerializer | ||
static protected array<string,array<string,callable>> | $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|null
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 72
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|null
buildRelationship(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null, bool $many = false)
in AbstractSerializer
at
line 222
protected mixed
getRelationshipData(mixed $model, string $relation)
in AbstractSerializer
at
line 238
protected SerializerInterface
resolveSerializer(mixed $serializer, mixed $model, mixed $data)
in AbstractSerializer
at
line 260
protected object
resolveSerializerClass(string $class)
in AbstractSerializer
at
line 272
static Container
getContainer()
in AbstractSerializer
at
line 282
static
setContainer(Container $container)
in AbstractSerializer
at
line 293
static void
addAttributeMutator(string $serializerClass, callable $callback)
in AbstractSerializer
at
line 309
static void
setRelationship(string $serializerClass, string $relation, callable $callback)
at
line 53
__construct(Config $config, Factory $filesystemFactory, SettingsRepositoryInterface $settings, UrlGenerator $url)
at
line 64
getId($model)
<p>{@inheritdoc}</p>