Pantheon\Terminus\Commands\Site\Org\RemoveCommand::remove PHP Метод

remove() публичный Метод

Remove a supporting organization from a site
public remove ( string $site, string $organization )
$site string The UUID or name of the site to be remove the organization from
$organization string The name or UUID of the organization to remove
    public function remove($site, $organization)
    {
        $org = $this->session()->getUser()->getOrgMemberships()->get($organization)->getOrganization();
        $site = $this->getSite($site);
        if ($membership = $site->getOrganizationMemberships()->get($organization)) {
            $workflow = $membership->delete();
            $this->log()->notice('Removing {org} as a supporting organization from {site}.', ['site' => $site->getName(), 'org' => $org->getName()]);
            while (!$workflow->checkProgress()) {
                // @TODO: Remove Symfony progress bar to indicate that something is happening.
            }
            $this->log()->notice($workflow->getMessage());
        } else {
            throw new TerminusException('The organization {org} does not appear to be a supporting member of {site}', ['site' => $site->getName(), 'org' => $org->getName()]);
        }
    }
RemoveCommand