3.0: Applying dispatchEvent()

Applying a feature introduced in #4556
Maybe you need to pass $table as the subject?