class UploadAvatarHandler

Traits

Properties

protected Dispatcher $events from DispatchEventsTrait
protected UserRepository $users
protected Application $app
protected AvatarUploader $uploader
protected AvatarValidator $validator

Methods

dispatchEventsFor(object $entity, User $actor = null)

<p>Dispatch all events for an entity.</p>

assertPermission($condition)

No description

assertCan(User $actor, string $ability, mixed $arguments = [])

No description

assertGuest(User $actor)

No description

assertRegistered(User $actor)

No description

assertAdmin(User $actor)

No description

__construct(Dispatcher $events, UserRepository $users, Application $app, AvatarUploader $uploader, AvatarValidator $validator)

No description

handle(UploadAvatar $command)

No description

Details

dispatchEventsFor(object $entity, User $actor = null)

<p>Dispatch all events for an entity.</p>

Parameters

object $entity
User $actor

protected assertPermission($condition)

Parameters

$condition

Exceptions

PermissionDeniedException

protected assertCan(User $actor, string $ability, mixed $arguments = [])

Parameters

User $actor
string $ability
mixed $arguments

Exceptions

PermissionDeniedException

protected assertGuest(User $actor)

Parameters

User $actor

Exceptions

PermissionDeniedException

protected assertRegistered(User $actor)

Parameters

User $actor

Exceptions

PermissionDeniedException

protected assertAdmin(User $actor)

Parameters

User $actor

Exceptions

PermissionDeniedException

__construct(Dispatcher $events, UserRepository $users, Application $app, AvatarUploader $uploader, AvatarValidator $validator)

Parameters

Dispatcher $events
UserRepository $users
Application $app
AvatarUploader $uploader
AvatarValidator $validator

User handle(UploadAvatar $command)

Parameters

UploadAvatar $command

Return Value

User

Exceptions

PermissionDeniedException