use Symfony\Component\EventDispatcher\Event; class MyEvent extends Event { protected $name; public function __construct($name) { $this->name = $name; } public function getName() { return $this->name; } } // Create a new instance of MyEvent $event = new MyEvent('my_event'); // Get the name of the event $name = $event->getName(); echo $name; // Output: my_eventIn this example, we have created a custom `MyEvent` class which extends the `Event` class from the Symfony Event package library. We have defined a constructor for the `MyEvent` class that sets a name property for the event object. The `getName` method is used to retrieve this name property from the event object. Package library: Symfony Event.