public function cleanupDeferredEventHandlers() { foreach ($this as $key => $property) { if ($property instanceof DeferredEvent) { $property->cleanup(); $this->{$key} = null; } } }