Heystack\Ecommerce\Transaction\Subscriber
Handles both subscribing to events and acting on those events needed for Transaction to work properly
- Author: Glenn Bautista <glenn@heyday.co.nz>
- Copyright: Heyday
Synopsis
class Subscriber
implements
EventSubscriberInterface
{
- // members
- protected TransactionInterface $transaction;
- protected EventDispatcherInterface $eventDispatcher;
- protected Storage $storageService;
- protected State $state;
- // methods
- public void __construct()
- public static array getSubscribedEvents()
- public void onUpdate()
- public void onStore()
- public void onTransactionStored()
Hierarchy
Implements
- Symfony\Component\EventDispatcher\EventSubscriberInterface
Members
protected
- $eventDispatcher
—
\Symfony\Component\EventDispatcher\EventDispatcherInterface
Holds the EventDispatcher Service object - $state — \Heystack\Core\State\State
- $storageService — \Heystack\Core\Storage\Storage
- $transaction
—
\Heystack\Ecommerce\Transaction\Interfaces\TransactionInterface
Holds the Transaction object
Methods
public
- __construct() — Creates the Susbcriber object
- getSubscribedEvents() — Returns an array of events to subscribe to and the methods to call when those events are fired
- onStore() — Method that facilitates storing the Transaction
- onTransactionStored() — Called after the Transaction is stored, clears state of transaction
- onUpdate() — Method that facilitiates updating the Transaction