Skip to content

Events

tilttek/collections-bundle

The bundle dispatches two events through the application's dispatcher:

EventWhenCarries
Tilttek\CollectionsBundle\Infrastructure\Event\CopyGrantedA member was given a copy — the item of the day, a pack, a reward, a purchasecopy
Tilttek\Collections\SetCompletedA member completed a set for the first time, just after the copy that completed itset, with its rewards, and completion
#[AsEventListener]
public function __invoke(SetCompleted $event): void
{
    foreach ($event->set->rewards as $reward) {
        // give $reward->amount of $reward->code to $event->completion->member
    }
}

A move between members dispatches no CopyGranted; it dispatches SetCompleted when it completes a set.