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

ServerRequestInterface
getRequest()

No description

setRequest(ServerRequestInterface $request)

No description

getActor()

No description

getAttributes($model, array $fields = null)

<p>{@inheritdoc}</p>

array
getDefaultAttributes(object|array $model)

<p>Get the default set of serialized attributes for a model.</p>

string|null
formatDate(DateTime $date = null)

No description

getRelationship($model, $name)

<p>{@inheritdoc}</p>

Relationship|null
getCustomRelationship(mixed $model, string $name)

<p>Get a custom relationship.</p>

Relationship
hasOne(mixed $model, string|Closure|SerializerInterface $serializer, string|Closure|null $relation = null)

<p>Get a relationship builder for a has-one relationship.</p>

Relationship
hasMany(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null)

<p>Get a relationship builder for a has-many relationship.</p>

Relationship|null
buildRelationship(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null, bool $many = false)

No description

mixed
getRelationshipData(mixed $model, string $relation)

No description

SerializerInterface
resolveSerializer(mixed $serializer, mixed $model, mixed $data)

No description

object
resolveSerializerClass(string $class)

No description

static Container
getContainer()

No description

static 
setContainer(Container $container)

No description

static void
addAttributeMutator(string $serializerClass, callable $callback)

No description

static void
setRelationship(string $serializerClass, string $relation, callable $callback)

No description

__construct(Config $config, Factory $filesystemFactory, SettingsRepositoryInterface $settings, UrlGenerator $url)

No description

getId($model)

<p>{@inheritdoc}</p>

Relationship
groups($model)

No description

string|null
getLogoUrl()

No description

string|null
getFaviconUrl()

No description

string
getAssetUrl($assetPath)

No description

Relationship|null
actor($model)

No description

Details

ServerRequestInterface getRequest()

Return Value

ServerRequestInterface

setRequest(ServerRequestInterface $request)

Parameters

ServerRequestInterface $request

User getActor()

Return Value

User

getAttributes($model, array $fields = null)

<p>{@inheritdoc}</p>

Parameters

$model
array $fields

protected array getDefaultAttributes(object|array $model)

<p>Get the default set of serialized attributes for a model.</p>

Parameters

object|array $model

Return Value

array

string|null formatDate(DateTime $date = null)

Parameters

DateTime $date

Return Value

string|null

getRelationship($model, $name)

<p>{@inheritdoc}</p>

Parameters

$model
$name

protected Relationship|null getCustomRelationship(mixed $model, string $name)

<p>Get a custom relationship.</p>

Parameters

mixed $model
string $name

Return Value

Relationship|null

Relationship hasOne(mixed $model, string|Closure|SerializerInterface $serializer, string|Closure|null $relation = null)

<p>Get a relationship builder for a has-one relationship.</p>

Parameters

mixed $model
string|Closure|SerializerInterface $serializer
string|Closure|null $relation

Return Value

Relationship

Relationship hasMany(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null)

<p>Get a relationship builder for a has-many relationship.</p>

Parameters

mixed $model
string|Closure|SerializerInterface $serializer
string|null $relation

Return Value

Relationship

protected Relationship|null buildRelationship(mixed $model, string|Closure|SerializerInterface $serializer, string|null $relation = null, bool $many = false)

Parameters

mixed $model
string|Closure|SerializerInterface $serializer
string|null $relation
bool $many

Return Value

Relationship|null

protected mixed getRelationshipData(mixed $model, string $relation)

Parameters

mixed $model
string $relation

Return Value

mixed

protected SerializerInterface resolveSerializer(mixed $serializer, mixed $model, mixed $data)

Parameters

mixed $serializer
mixed $model
mixed $data

Return Value

SerializerInterface

Exceptions

InvalidArgumentException

protected object resolveSerializerClass(string $class)

Parameters

string $class

Return Value

object

static Container getContainer()

Return Value

Container

static setContainer(Container $container)

Parameters

Container $container

static void addAttributeMutator(string $serializerClass, callable $callback)

Parameters

string $serializerClass
callable $callback

Return Value

void

static void setRelationship(string $serializerClass, string $relation, callable $callback)

Parameters

string $serializerClass
string $relation
callable $callback

Return Value

void

__construct(Config $config, Factory $filesystemFactory, SettingsRepositoryInterface $settings, UrlGenerator $url)

Parameters

Config $config
Factory $filesystemFactory
SettingsRepositoryInterface $settings
UrlGenerator $url

getId($model)

<p>{@inheritdoc}</p>

Parameters

$model

protected Relationship groups($model)

Parameters

$model

Return Value

Relationship

protected string|null getLogoUrl()

Return Value

string|null

protected string|null getFaviconUrl()

Return Value

string|null

string getAssetUrl($assetPath)

Parameters

$assetPath

Return Value

string

protected Relationship|null actor($model)

Parameters

$model

Return Value

Relationship|null