class BasicUserSerializer extends AbstractSerializer

Properties

protected ServerRequestInterface $request from AbstractSerializer
protected User $actor from AbstractSerializer
static protected Dispatcher $dispatcher from AbstractSerializer
static protected Container $container from AbstractSerializer
protected $type <p>{@inheritdoc}</p>

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 Dispatcher
getEventDispatcher()

No description

static 
setEventDispatcher(Dispatcher $dispatcher)

No description

static Container
getContainer()

No description

static 
setContainer(Container $container)

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

protected 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 Dispatcher getEventDispatcher()

Return Value

Dispatcher

static setEventDispatcher(Dispatcher $dispatcher)

Parameters

Dispatcher $dispatcher

static Container getContainer()

Return Value

Container

static setContainer(Container $container)

Parameters

Container $container

protected Relationship groups($user)

Parameters

$user

Return Value

Relationship