Source of file Event.php
Size: 1,040 Bytes - Last Modified: 2021-12-23T10:30:09+00:00
/var/www/docs.ssmods.com/process/src/src/Symfony/Event.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 | <?php namespace SilverStripe\EventDispatcher\Symfony; use SilverStripe\Core\Injector\Injectable; use SilverStripe\EventDispatcher\Event\EventContextInterface; use Symfony\Component\EventDispatcher\GenericEvent; class Event implements EventContextInterface { use Injectable; /** * @var GenericEvent */ private $event; /** * Event constructor. * @param string $action * @param array $properties */ public function __construct(string $action = null, array $properties = []) { $this->event = new GenericEvent($action, $properties); } /** * @return string|null */ public function getAction(): ?string { return $this->event->getSubject(); } /** * @param string $name * @return mixed|null */ public function get(string $name) { try { $arg = $this->event->getArgument($name); return $arg; } catch (\InvalidArgumentException $e) { return null; } } } |