Store all actions about modules create/update/delete in own table.

@param \core\event\base $event
548798
public static function store(\core\event\base $event) {
        global $DB;
        $eventdata = new \stdClass();
        switch ($event->eventname) {
            case '\core\event\course_module_created':
                $eventdata->action = self::CM_CREATED;
                break;
            case '\core\event\course_module_updated':
                $eventdata->action = self::CM_UPDATED;
                break;
            case '\core\event\course_module_deleted':
                $eventdata->action = self::CM_DELETED;
                $eventdata->modname = $event->other['modulename'];
                break;
            default:
                return;
        }
        $eventdata->timecreated = $event->timecreated;
        $eventdata->courseid = $event->courseid;
        $eventdata->cmid = $event->objectid;
        $eventdata->userid = $event->userid;
        $DB->insert_record('block_recent_activity', $eventdata);
    }
3480
public function onUpdated(UpdatedEvent $event)
    {
        if ($event->getPackage()->getType() == self::PLUGIN_TYPE) {
            $this->addPackage($event->getPackage());
        }
    }
1299289
public static function remove(\core\event\base $event) {
        global $DB;

        $DB->delete_records(self::$table, array('cmid' => $event->contextinstanceid));
    }
969598
public function postCreate(CreateEvent $event)
    {
        $organization = $event->getObject();
        $key = $this->cryptoManager->generatePair();
        $key->setOrganization($organization);
        $this->om->persist($key);
        $this->om->flush();
    }
1215958
public function bindPluginEvents(Event $event)
    {
        foreach ($this->plugins as $field => $plugin) {
            $plugin = self::findPluginInstance($field, $plugin, $event->sender->tableName());
            foreach ($plugin->events() as $on => $handler) {
                $event->sender->on($on, is_string($handler) ? [$plugin, $handler] : $handler);
            }
        }
    }
1271323
public function onInit(BaseEvent $event)
    {
        $this->state->loadSettings();
        // It is not possible to know if the user specified --dev or --no-dev so assume it is false.
        // The dev section will be merged later when the other events fire.
        $this->state->setDevMode(false);
        $this->mergeFiles($this->state->getIncludes(), false);
        $this->mergeFiles($this->state->getRequires(), true);
    }
908658
public function onPostCmdEvent(Event $event) {
    // Only install the template files if acquia/blt was installed.
    if (isset($this->bltPackage)) {
      $version = $this->bltPackage->getVersion();
      $this->executeBltUpdate($version);
    }
  }
302888
public static function dispatch(\core\event\base $event) {
        if (during_initial_install()) {
            return;
        }
        if (!$event->is_triggered() or $event->is_dispatched()) {
            throw new \coding_exception('Illegal event dispatching attempted.');
        }

        self::$buffer[] = $event;

        if (self::$dispatching) {
            return;
        }

        self::$dispatching = true;
        self::process_buffers();
        self::$dispatching = false;
    }
932707
public function recordThat(Event $event): void
    {
        $this->handleRecursively($event);
        parent::recordThat($event);
    }
5839
public function onPostAutoloadDump(Event $event)
    {
        $this->io->writeError('<info>Generating extensions files</info>');
        foreach ($this->getPackages() as $package) {
            if ($package instanceof \Composer\Package\CompletePackageInterface) {
                $this->processPackage($package);
            }
        }
        $this->processPackage($this->composer->getPackage());

        foreach ($this->data as $name => $data) {
            $this->saveFile($this->buildOutputPath($name), $data);
        }
    }
34460
public static function postInstall(Event $event)
    {
        require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';

        static::clearCompiled();
        static::artisanOptimize();
        static::artisanLangJS();
    }
410632
public function beforeInsert($event)
    {
        $fields = $this->fields;
        $nowDate = gmdate($this->databaseTimeFormat);
        if (!$this->isActuallyDirty()) {
            return;
        }

        if (isset($this->fields['createdField']) && !$this->owner->isAttributeChanged($this->fields['createdField'])) {
            $this->owner->{$this->fields['createdField']} = $nowDate;
        }
        if (isset($this->fields['createdByField']) && !$this->owner->isAttributeChanged($this->fields['createdByField'])) {
            $this->owner->{$this->fields['createdByField']} = self::_getUserId();
        }

        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();
        }
    }
114756
protected function beforeSave($event)
    {
        if ($this->autoSave) {
            $this->saveFile($this->owner->{$this->uploadAttribute}, $this->name, $this->path);
        }
    }
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);
            }
        }
    }
979788
public function onPostInstall(Event $event)
    {
        $lockFile = new JsonFile($this->lockFile);
        if ($lockFile->exists()) {
            $this->loadPackages($lockFile);
        } else {
            $this->scanPackages();
        }
        $this->runAction('install');
    }
240035
public function beforeDelete($event)
    {
        $oldId = $this->owner->{$this->savedAttribute};
        if (($oldModel = FileModel::findOne($oldId)) !== null) {
            $event->isValid = $event->isValid && $oldModel->delete();
        }
    }
1010084
public function onPostAutoloadDump(Event $event)
    {
        $this->io->overwriteError('<info>Assembling config files</info>');

        $this->builder = new Builder();

        $this->initAutoload();
        $this->scanPackages();
        $this->reorderFiles();
        $this->showDepsTree();

        $this->builder->buildAllConfigs($this->files);
    }