Pantheon\Terminus\Commands\Site\Org\AddCommand::add PHP Method

add() public method

Add a supporting organization to a site
public add ( string $site, string $organization )
$site string The UUID or name of the site to add the organization to
$organization string The name or UUID of the organization to add to the site
    public function add($site, $organization)
    {
        $org = $this->session()->getUser()->getOrgMemberships()->get($organization)->getOrganization();
        $site = $this->getSite($site);
        $workflow = $site->getOrganizationMemberships()->create($organization, 'team_member');
        $this->log()->notice('Adding {org} as a supporting organization to {site}.', ['site' => $site->getName(), 'org' => $org->getName()]);
        while (!$workflow->checkProgress()) {
            // @TODO: Add Symfony progress bar to indicate that something is happening.
        }
        $this->log()->notice($workflow->getMessage());
    }
AddCommand