Override _attrEventBeforeDelete()
322353
public function _attrEventBeforeDelete(&$attributes)
    {
        // Auto deleted_by
        if ($this->deletedUserAttribute && !isset($attributes[$this->deletedUserAttribute])) {
            $attributes[$this->deletedUserAttribute] = $this->user->getID();
        }
        return parent::_attrEventBeforeDelete($attributes);
    }
1281489
protected function onBeforeDelete()
    {
        $this->brokenOnDelete = false;

        $dummy = null;
        $this->extend('onBeforeDelete', $dummy);

        // Cascade deletes
        $deletes = $this->findCascadeDeletes(false);
        foreach ($deletes as $delete) {
            $delete->delete();
        }
    }
1021841
void onFilterChangedEvent(@Observes FilterChangedEvent filterChangedEvent) {
        checkNotNull("filterChangedEvent",
                     filterChangedEvent);
        if (filterChangedEvent.getContext().equals(dataSetFilterEditor)) {
            final DataSetFilter old = filterChangedEvent.getOldFilter();
            final DataSetFilter f = filterChangedEvent.getFilter();
            updateColumnsRestrictedByFilter(old,
                                            f);
        }
    }
183268
def _event_for(self, elts):
        """"""
        event = Event()
        event.canceller = self._canceller_for(elts, event)
        return event
1135770
def _after_event(self, e):
        '''
            
        '''
        ''' my patch, serialize to redis '''
        self.r.set(self.rhname, self.current)
        for fnname in ['onafter' + e.event, 'on' + e.event]:
            if hasattr(self, fnname):
                return getattr(self, fnname)(e)
409830
public function onBeforeWrite() {
        parent::onBeforeWrite();
        
        if(empty($this->owner->DefaultPreviewMode)) {
            $this->owner->DefaultPreviewMode=Config::inst()->get('UserPreviewPreference', 'DefaultMode');
        }
        
        
        //If changed ensure their is a session message
        if($this->owner->isChanged('DefaultPreviewMode')) {
            Controller::curr()->getRequest()->getSession()->set('ShowPreviewSettingChangeReload', true);
            $this->isSaving=true;
        }
    }
57740
function() {
		var e = this.originalEvent;
		this.defaultPrevented = true;
    this.isDefaultPrevented = returnTrue;
		if ( e && e.preventDefault ){ e.preventDefault(); }
	}
260534
public function onBeforeWrite()
    {
        // Call Parent Event:
        
        parent::onBeforeWrite();
        
        // Detect Media URL Change:
        
        if ($this->isChanged('MediaURL', 2) || $this->ForceUpdate) {
            
            // Obtain Adapter Object:
            
            if ($adapter = Embed::create($this->MediaURL)) {
                
                // Define Type and Code:
                
                $this->Type   = $adapter->getType();
                $this->Code   = $adapter->getCode();
                
                // Define Dimensions:
                
                $this->Width  = $adapter->getWidth();
                $this->Height = $adapter->getHeight();
                
                // Define Title and Description:
                
                $this->MediaTitle  = $adapter->getTitle();
                $this->Description = $adapter->getDescription();
                
                // Define Aspect Ratio:
                
                $this->AspectRatio = $adapter->getAspectRatio();
                
                // Define Image URL and Dimensions:
                
                $this->ImageURL    = $adapter->getImage();
                $this->ImageWidth  = $adapter->getImageWidth();
                $this->ImageHeight = $adapter->getImageHeight();
                
            }
            
        }
    }
257864
public function beforeSendPerformed(Swift_Events_SendEvent $evt)
    {
        $message = $evt->getMessage();

        // replace sender
        if (0 === count($message->getFrom())) {
            $message->setFrom($this->defaultFrom);
            $this->handledMessageIds[$message->getId()] = true;
        }

        // replace sender
        if (empty($message->getReplyTo())) {
            $message->setReplyTo($this->defaultReplyTo);
            $this->handledMessageIds[$message->getId()] = true;
        }
    }
659700
protected void fireBeforePersist() {
        PersistableListener l = _listener;
        
        if(l != null) {
            try {
                l.beforePersist();
            } catch(Exception e) {
                _log.error("failure on calling beforePersist", e);
            }
        }
    }
616000
function CancelableEvent (type, eventInit) {
        if ( eventInit === void 0 ) eventInit = {};

        Object.assign(this, CancelableEvent.defaults(), eventInit, { type: type });

        Object.defineProperties(this, {
            type: _makeCancelableEventProps(),
            cancelable: _makeCancelableEventProps(),
            nativeEvent: _makeCancelableEventProps(),
            target: _makeCancelableEventProps(),
            relatedTarget: _makeCancelableEventProps(),
            vueTarget: _makeCancelableEventProps()
        });

        var defaultPrevented = false;

        this.preventDefault = function preventDefault() {
            if (this.cancelable) {
                defaultPrevented = true;
            }
        };

        Object.defineProperty(this, 'defaultPrevented', {
            enumerable: true,
            get: function get() {
                return defaultPrevented
            }
        });
    }
62192
public function onBeforeWrite()
    {
        $colorPickerEnabled = $this->owner->config()->get('enable_theme_color_picker');

        if ($colorPickerEnabled && !$this->owner->HeaderBackground) {
            $this->owner->update([
                'MainFontFamily' => FontPickerField::DEFAULT_VALUE,
                'HeaderBackground' => 'default-background',
                'NavigationBarBackground' => 'default-background',
                'CarouselBackground' => 'default-background',
                'FooterBackground' => 'default-background',
                'AccentColor' => 'default-accent',
                'TextLinkColor' => 'default-accent',
            ]);
        }
    }
172352
private function preBindDoctrineEvent() : void
    {
        if(EventScheduler::instance()->has(Event::DATA_CHANGED)){
            $this->getEventManager()->addEventListener([Events::postPersist, Events::postUpdate, Events::postRemove], new Class{
                public function postPersist(LifecycleEventArgs $args) : void
                {
                    EventScheduler::instance()->trigger(Event::DATA_CHANGED, ['created', $args->getEntityManager(), $args->getEntity()]);
                }

                public function postUpdate(LifecycleEventArgs $args) : void
                {
                    EventScheduler::instance()->trigger(Event::DATA_CHANGED, ['updated', $args->getEntityManager(), $args->getEntity()]);
                }

                public function postRemove(LifecycleEventArgs $args) : void
                {
                    EventScheduler::instance()->trigger(Event::DATA_CHANGED, ['deleted', $args->getEntityManager(), $args->getEntity()]);
                }
            });
        }
    }
47774
public void onGeometryEditStart(GeometryEditStartEvent event) {
		if (container != null) {
			mapPresenter.getContainerManager().removeVectorContainer(container);
		}
		container = mapPresenter.getContainerManager().addScreenContainer();
		redraw();
	}
682623
function() {
        this.cal.beforeRenderNavEvent.fire();
        if (!this.__rendered) {
            this.createNav();
            this.createMask();
            this.applyListeners();
            this.__rendered = true;
        }
        this.cal.renderNavEvent.fire();
    }
537827
def OnContentChanged(self, event):
        """"""

        self.main_window.grid.update_attribute_toolbar()

        title = self.main_window.GetTitle()

        if undo.stack().haschanged():
            # Put * in front of title
            if title[:2] != "* ":
                new_title = "* " + title
                post_command_event(self.main_window, self.main_window.TitleMsg,
                                   text=new_title)

        elif title[:2] == "* ":
            # Remove * in front of title
            new_title = title[2:]
            post_command_event(self.main_window, self.main_window.TitleMsg,
                               text=new_title)
917172
function(pref, down, move, up, cancel) {
				_dragStartEvent = pref + down;
				_dragMoveEvent = pref + move;
				_dragEndEvent = pref + up;
				if(cancel) {
					_dragCancelEvent = pref + cancel;
				} else {
					_dragCancelEvent = '';
				}
			}