PHP code example of mage-os / mageos-async-events
1. Go to this page and download the library: Download mage-os/mageos-async-events library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mage-os / mageos-async-events example snippets
use \MageOS\AsyncEvents\Model\AsyncEventPublisher;
// ...
public function __construct(private readonly AsyncEventPublisher $asyncEventPublisher) {}
public function execute(Observer $observer): void
{
/** @var Order $order */
$order = $observer->getData('order');
// arguments are the inputs