Triggered via \core\event\course_updated event.

@param \core\event\course_updated $event
556092
public static function course_updated(\core\event\course_updated $event) {
        if (class_exists('format_weeks', false)) {
            // If class format_weeks was never loaded, this is definitely not a course in 'weeks' format.
            // Course may still be in another format but format_weeks::update_end_date() will check it.
            format_weeks::update_end_date($event->courseid);
        }
    }
1310723
private function fireEvent($event)
    {
        $env = $this->formatEventName($event);

        if (emitter()->bound($env)) {
            emitter()->emit($env, $this);
        }
    }
962268
public function update($event, $value)
    {
        if (null === $value) {
            return;
        }

        $event->setOptions($value);
        $event->stopPropagation();
    }
531968
public function beforeUpdate($event)
    {
        $fields = $this->fields;
        $nowDate = gmdate($this->databaseTimeFormat);
        if (!$this->isActuallyDirty()) {
            return;
        }

        if (isset($this->fields['modifiedField']) && !$this->owner->isAttributeChanged($this->fields['modifiedField'])) {
            $this->owner->{$this->fields['modifiedField']} = $nowDate;
        }
        if (isset($this->fields['modifiedByField']) && !$this->owner->isAttributeChanged($this->fields['modifiedByField'])) {
            $this->owner->{$this->fields['modifiedByField']} = self::_getUserId();
        }
    }
463569
public static function group_deleted($event) {
        if (!empty(self::$resetinprogress)) {
            // We will take care of that once the course reset ends.
            return;
        }
        lesson_process_group_deleted_in_course($event->courseid, $event->objectid);
    }
1072947
public static function observe_course_completed(\core\event\course_completed $event) {
        if (!static::is_enabled()) {
            return;
        }

        $sql = 'courseid = :courseid AND ruleoutcome != :nooutcome';
        $params = array(
            'courseid' => $event->courseid,
            'nooutcome' => course_competency::OUTCOME_NONE
        );
        $coursecompetencies = course_competency::get_records_select($sql, $params);

        $course = get_course($event->courseid);
        $courseshortname = format_string($course->shortname, null, array('context' => $event->contextid));

        foreach ($coursecompetencies as $coursecompetency) {

            $outcome = $coursecompetency->get('ruleoutcome');
            $action = null;
            $recommend = false;
            $strdesc = 'evidence_coursecompleted';

            if ($outcome == course_competency::OUTCOME_EVIDENCE) {
                $action = evidence::ACTION_LOG;

            } else if ($outcome == course_competency::OUTCOME_RECOMMEND) {
                $action = evidence::ACTION_LOG;
                $recommend = true;

            } else if ($outcome == course_competency::OUTCOME_COMPLETE) {
                $action = evidence::ACTION_COMPLETE;

            } else {
                throw new moodle_exception('Unexpected rule outcome: ' + $outcome);
            }

            static::add_evidence(
                $event->relateduserid,
                $coursecompetency->get('competencyid'),
                $event->contextid,
                $action,
                $strdesc,
                'core_competency',
                $courseshortname,
                $recommend,
                $event->get_url()
            );
        }
    }
750795
private function captureStepEvent(Event $event)
    {
        if ($event instanceof AfterStepTested) {
            $this->afterStepTestedEvents[$event->getStep()->getLine()] = $event;
        }
        if ($event instanceof AfterStepSetup) {
            $this->afterStepSetupEvents[$event->getStep()->getLine()] = $event;
        }
    }
868480
protected function update(Event $event)
    {
        $this->dispatch(static::EVENT_UPDATE_BEFORE, $event);
        if (!$event->isPropagationStopped()) {
            $this->updateProcess($event);
            if (!$event->isPropagationStopped()) {
                $this->dispatch(static::EVENT_UPDATE_AFTER, $event);
            }
        }
    }
141599
public function handle(ProfileWasUpdated $event)
    {
        //If the user requested a new email address, we create a new email change
        //petition record in the database and send out a confirmation email.
        if ($continuePropagation = $this->emailWasChanged($event)) {
            $this->createNewEmailPetition($event);
        }

        $this->updateUserPorfile($event->request);

        //The event propagation will continue as long as the user changed his email address.
        return $continuePropagation;
    }
1119615
public function onChildRowUpdate(Kwf_Events_Event_Row_Updated $event)
    {
        $dbId = $event->row->component_id;
        $c = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($dbId, array('limit'=>1, 'ignoreVisible'=>true));
        if ($c && $c->parent->componentClass == $this->_class) {
            $this->fireEvent(new Kwc_Directories_List_EventItemUpdated($this->_class, $c->id, $c->getSubroot()));
            $this->fireEvent(new Kwc_Directories_List_EventItemDeleted($this->_class, $c->id, $c->getSubroot()));
        }
    }
1330576
public function notify($event = null)
    {
        /* @var Doozr_Base_Crud_Interface $observer */
        foreach ($this->observer as $observer) {
            $observer->update($this, $event);
        }

        $this->clear();
    }
780049
public static function onPreUpdate(Event $event)
    {
        $page = $event->getTarget();
        $eventArgs = $event->getEventArgs();
        $updateParents = false;
        $new = $old = null;

        $pageCountModifier = -1;
        if ($eventArgs instanceof PreUpdateEventArgs) {
            if ($page instanceof Page && $eventArgs->hasChangedField('_section')) {
                $old = $eventArgs->getOldValue('_section');
                $new = $eventArgs->getNewValue('_section');

                if ($new->getUid() === $page->getUid()) {
                    return;
                }
                $updateParents = true;
            }

            if ($page instanceof Page && $eventArgs->hasChangedField('_state')) {
                if ($page->getParent() !== null) {
                    if ($eventArgs->getNewValue('_state') >= 4) {
                        $old = $page->getParent()->getSection();
                        if (!$page->isLeaf()) {
                            $pageCountModifier = 0;
                        }
                    } else {
                        $new = $page->getParent()->getSection();
                    }
                    $updateParents = true;
                }
            }

            if ($page instanceof Section && $eventArgs->hasChangedField('_parent')) {
                $old = $eventArgs->getOldValue('_parent');
                $new = $eventArgs->getNewValue('_parent');
                $updateParents = true;
            }

            if ($updateParents) {
                $em = $event->getApplication()->getEntityManager();

                self::setSectionHasChildren($em, $old, $pageCountModifier);
                self::setSectionHasChildren($em, $new, +1);
            }
        }
    }
31907
public function handle($event)
    {
        if ($event instanceof RouteMatched) {
            $this->handleLaravelRoute($event);
        }

        if ($event instanceof GzeroRouteMatched) {
            $this->handleRoute($event);
        }
    }
698904
final protected function apply(DomainEvent $event) : void
    {
        $this->handleEventInAggregate($event);
        parent::raise($event);
    }
760104
protected function trigger ($event)
	{
		$arguments = func_get_args ();
		array_shift ($arguments);

		// Check for events
		if (isset ($this->events[$event]))
		{
			foreach ($this->events[$event] as $call)
			{
				call_user_func_array ($call, $arguments);
			}
		}

		// Notify everyone
		foreach ($this->observing as $observer)
		{
			$observer->update ();
		}
	}
1243502
protected function fireConnectionEvent( $event )
	{
		if( isset( $this->events ) )
		{
			switch( $event ) {
				case 'beganTransaction': $this->events->dispatch( new Events\TransactionBeginningEvent( $this ) ); break;
				case 'committed': $this->events->dispatch( new Events\TransactionCommittedEvent( $this ) ); break;
				case 'rollingBack': $this->events->dispatch( new Events\TransactionRolledBackEvent( $this ) ); break;
			}
		}
	}
830481
protected function fireEvent($event)
    {
        $this->app['events']->fire(sprintf('modules.%s.'.$event, $this->getLowerName()), [$this]);
    }