PHP Class Flarum\Event\PrepareApiAttributes

This event is fired when a serialize is constructing an array of resource attributes for API output.
Exibir arquivo Open project: flarum/core Class Usage Examples

Public Properties

Property Type Description
$actor Flarum\Core\User
$attributes array The serialized attributes of the resource.
$model object The model being serialized.
$serializer Flarum\Api\Serializer\AbstractSerializer The class doing the serializing.

Public Methods

Method Description
__construct ( AbstractSerializer $serializer, object | array $model, array &$attributes )
formatDate ( DateTime $date = null ) : string | null
isSerializer ( string $serializer ) : boolean

Method Details

__construct() public method

public __construct ( AbstractSerializer $serializer, object | array $model, array &$attributes )
$serializer Flarum\Api\Serializer\AbstractSerializer The class doing the serializing.
$model object | array The model being serialized.
$attributes array The serialized attributes of the resource.

formatDate() public method

public formatDate ( DateTime $date = null ) : string | null
$date DateTime
return string | null

isSerializer() public method

public isSerializer ( string $serializer ) : boolean
$serializer string
return boolean

Property Details

$actor public_oe property

public User,Flarum\Core $actor
return Flarum\Core\User

$attributes public_oe property

The serialized attributes of the resource.
public array $attributes
return array

$model public_oe property

The model being serialized.
public object $model
return object

$serializer public_oe property

The class doing the serializing.
public AbstractSerializer,Flarum\Api\Serializer $serializer
return Flarum\Api\Serializer\AbstractSerializer