class BasicUserSerializer 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

ServerRequestInterface
getRequest()

No description

setRequest(ServerRequestInterface $request)

No description

getActor()

No description

getAttributes($model, array $fields = null)

<p>{@inheritdoc}</p>

array
getDefaultAttributes(User $user)

<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
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(SlugManager $slugManager)

No description

Relationship
groups($user)

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(User $user)

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

Parameters

User $user

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 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

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(SlugManager $slugManager)

Parameters

SlugManager $slugManager

protected Relationship groups($user)

Parameters

$user

Return Value

Relationship