class PlainEvent

An Event that has properties but no explicit getter methods.

"Plain" events like this don't have getter methods and don't subclass from GenericEvent so there is no way to directly access their non-public properties unless special steps are taken.

This class is meant for testing. A 'real' event class would also have a constructor and/or setter methods to set the initial values of the properties, and might have non-getter methods that make use of these properties to return a value.

Hierarchy

  • class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event
    • class \Drupal\rules_test_event\Event\PlainEvent extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of PlainEvent

See also

\Drupal\rules\EventSubscriber\GenericEventSubscriber

3 files declare their use of PlainEvent
DispatchForm.php in tests/modules/rules_test_event/src/Form/DispatchForm.php
EventPropertyAccessTest.php in tests/src/Unit/Integration/Event/EventPropertyAccessTest.php
EventPropertyAccessTest.php in tests/src/Kernel/EventPropertyAccessTest.php
1 string reference to 'PlainEvent'
DispatchForm::buildForm in tests/modules/rules_test_event/src/Form/DispatchForm.php
Form constructor.

File

tests/modules/rules_test_event/src/Event/PlainEvent.php, line 21

Namespace

Drupal\rules_test_event\Event
View source
class PlainEvent extends DrupalEvent {
    const EVENT_NAME = 'rules_test_event.plain_event';
    
    /**
     * A public property.
     *
     * @var string
     */
    public $publicProperty = 'public property';
    
    /**
     * A protected property.
     *
     * @var string
     */
    protected $protectedProperty = 'protected property';
    
    /**
     * A private property.
     *
     * @var string
     */
    private $privateProperty = 'private property';

}

Members

Title Sort descending Modifiers Object type Summary
PlainEvent::$privateProperty private property A private property.
PlainEvent::$protectedProperty protected property A protected property.
PlainEvent::$publicProperty public property A public property.
PlainEvent::EVENT_NAME constant