Remove App.

@param AnCommandContext $context Context parameter
557849
protected function _actionRemoveapp(AnCommandContext $context)
    {
        $data = $context->data;
        $this->getItem()->components->extract($data->app);
        $this->commit();
    }
478623
public static function delete_data_for_all_users_in_context(\context $context) {
        global $CFG, $DB;
        require_once($CFG->libdir.'/gradelib.php');

        if ($context->contextlevel != CONTEXT_MODULE) {
            return;
        }

        $cm = get_coursemodule_from_id('workshop', $context->instanceid, 0, false, IGNORE_MISSING);

        if (!$cm) {
            // Probably some kind of expired context.
            return;
        }

        $workshop = $DB->get_record('workshop', ['id' => $cm->instance], 'id, course', MUST_EXIST);

        $submissions = $DB->get_records('workshop_submissions', ['workshopid' => $workshop->id], '', 'id');
        $assessments = $DB->get_records_list('workshop_assessments', 'submissionid', array_keys($submissions), '', 'id');

        $DB->delete_records('workshop_aggregations', ['workshopid' => $workshop->id]);
        $DB->delete_records_list('workshop_grades', 'assessmentid', array_keys($assessments));
        $DB->delete_records_list('workshop_assessments', 'id', array_keys($assessments));
        $DB->delete_records_list('workshop_submissions', 'id', array_keys($submissions));

        $fs = get_file_storage();
        $fs->delete_area_files($context->id, 'mod_workshop', 'submission_content');
        $fs->delete_area_files($context->id, 'mod_workshop', 'submission_attachment');
        $fs->delete_area_files($context->id, 'mod_workshop', 'overallfeedback_content');
        $fs->delete_area_files($context->id, 'mod_workshop', 'overallfeedback_attachment');

        grade_update('mod/workshop', $workshop->course, 'mod', 'workshop', $workshop->id, 0, null, ['reset' => true]);
        grade_update('mod/workshop', $workshop->course, 'mod', 'workshop', $workshop->id, 1, null, ['reset' => true]);

        \core_plagiarism\privacy\provider::delete_plagiarism_for_context($context);
    }
19499
public function redirect(AnCommandContext $context)
    {
        $url['view'] = AnInflector::pluralize($this->getIdentifier()->name);
        $url['option'] = $this->getIdentifier()->package;

        if ($context->action == 'add') {
            $url['id'] = $this->getItem()->id;
        } elseif ($context->action == 'delete') {
            $url['oid'] = $this->getItem()->owner->id;
        }

        $this->getResponse()->setRedirect(route($url));
    }
732388
public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $defaultConnection = $setup->getConnection();

        $this->dropTable($setup, Schema::EMAIL_CONTACT_CONSENT_TABLE);
        $this->dropTable($setup, Schema::EMAIL_CONTACT_TABLE);
        $this->dropTable($setup, Schema::EMAIL_ORDER_TABLE);
        $this->dropTable($setup, Schema::EMAIL_CAMPAIGN_TABLE);
        $this->dropTable($setup, Schema::EMAIL_REVIEW_TABLE);
        $this->dropTable($setup, Schema::EMAIL_WISHLIST_TABLE);
        $this->dropTable($setup, Schema::EMAIL_CATALOG_TABLE);
        $this->dropTable($setup, Schema::EMAIL_RULES_TABLE);
        $this->dropTable($setup, Schema::EMAIL_IMPORTER_TABLE);
        $this->dropTable($setup, Schema::EMAIL_AUTOMATION_TABLE);
        $this->dropTable($setup, Schema::EMAIL_ABANDONED_CART_TABLE);
        $this->dropTable($setup, Schema::EMAIL_FAILED_AUTH_TABLE);

        $defaultConnection->dropColumn(
            $this->getTableNameWithPrefix($setup, 'admin_user'),
            'refresh_token'
        );

        $defaultConnection->delete(
            $this->getTableNameWithPrefix($setup, 'core_config_data'),
            "path LIKE 'connector_api_credentials/%'"
        );
    }
663817
protected synchronized void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "Deactivating");
        }

        // Unregister all services that we registered.
        while (!sslOptions.isEmpty()) {
            Iterator<Map.Entry<String, SSLChannelOptions>> i = sslOptions.entrySet().iterator();
            while (i.hasNext()) {
                Map.Entry<String, SSLChannelOptions> entry = i.next();
                entry.getValue().unregister();
                i.remove();
            }
        }
        sslConfigs.deactivate(context);

        cfwBundle.getFramework().deregisterFactories(this);

        bContext = null;

        // clear the instance if we haven't been replaced.
        instance.compareAndSet(this, null);
    }
641728
protected function _actionDelete(AnCommandContext $context)
    {
        $this->getResponse()->status = AnHttpResponse::NO_CONTENT;

        $token = $this->getService('repos:connect.session')->fetchSet(array(
                        'owner' => $this->actor,
                        'api' => $this->getAPI()->getName(),
                    ));

        $token->delete()->save();
    }
1350715
@Deactivate
    protected void deactivate(ComponentContext context) {
        SibTr.entry(tc, CLASS_NAME + "deactivate", context);

        runtimeSecurityService.modifyMessagingServices(null);
        queuePermissions = null;
        topicPermissions = null;
        temporaryDestinationPermissions = null;
        sibAuthenticationService = null;
        sibAuthorizationService = null;
        this.bundleLocation = null;
        
        SibTr.exit(tc, CLASS_NAME + "deactivate");
    }
418475
protected function _actionDelete(AnCommandContext $context)
    {
        $viewer = $this->_state->viewer;
        $person_id = $viewer->id;
        dispatch_plugin('user.onBeforeLogoutPerson', array('person' => $viewer));
        $this->getService('com:people.helper.person')->logout($viewer);
        dispatch_plugin('user.onAfterLogoutPerson', array('id' => $person_id));
        $context->response->setRedirect(route('index.php?'));
    }
418694
protected function _afterEntityDelete(AnCommandContext $context)
    {
        $this->getSpace()->setEntityState($context->entity, AnDomain::STATE_DESTROYED);
    }
985823
public static function unregisterApp(?string $app = null): void
    {
        self::initialize();
        if ($app === null) {
            $app = '*';
        }
        if (self::isAppRegistered($app)) {
            unset(self::$repositories[$app]);
        }
    }
330409
public static function delete_data_for_all_users_in_context(\context $context) {
        global $DB;

        if (!($context instanceof \context_course || $context instanceof \context_module)) {
            return;
        }

        $enrolltitools = $DB->get_fieldset_select('enrol_lti_tools', 'id', 'contextid = :contextid',
            ['contextid' => $context->id]);
        if (!empty($enrolltitools)) {
            list($sql, $params) = $DB->get_in_or_equal($enrolltitools, SQL_PARAMS_NAMED);
            $DB->delete_records_select('enrol_lti_users', 'toolid ' . $sql, $params);
        }
    }
738258
public function setContext($context)
    {
        if ($context === self::CONTEXT_APP || $context === self::CONTEXT_USER) {
            $this->context = $context;
        } else {
            throw new InvalidArgumentException('Incorrect context');
        }
    }
580577
protected function _actionRemovephoto($context)
    {
        $lastPhoto = ($this->getItem()->photos->getTotal() > 1) ? false : true;
        $this->getItem()->removePhoto($this->photo);

        if ($lastPhoto) {
            $this->getResponse()->status = 204;

            return;
        } else {
            return $this->getItem();
        }
    }
717653
protected function _actionDelete($context)
    {
        $context->response->status = AnHttpResponse::NO_CONTENT;
        $this->getItem()->delete();
        $context->response->setRedirect(route($this->getItem()->owner->getURL()));
    }
842739
def app_remove(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('app:remove', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })
188226
protected void deactivate(ComponentContext context) {
        securityServiceRef.deactivate(context);
        unauthSubjectServiceRef.deactivate(context);
        authServiceRef.deactivate(context);
        credServiceRef.deactivate(context);

    }
1331363
protected void deactivate(ComponentContext context) {
        appListener.unregister(this);

        // shut down instances that were created
        if (!clients.isEmpty())
            AccessController.doPrivileged(new PrivilegedAction<Void>() {
                @Override
                public Void run() {
                    Method shutdown = null;
                    for (Object client : clients.values())
                        try {
                            if (shutdown == null)
                                shutdown = client.getClass().getMethod("shutdown");
                            shutdown.invoke(client);
                        } catch (Throwable x) {
                            // FFDC will be logged, otherwise ignore
                        }
                    return null;
                }
            });

        containerAuthDataRef.deactivate(context);
        sslConfig.deactivate(context);
    }