Pantheon\Terminus\Collections\OrganizationSiteMemberships::get PHP Method

get() public method

Retrieves the model with site of the given UUID or name
public get ( string $id ) : OrganizationSiteMembership
$id string UUID or name of desired site membership instance
return OrganizationSiteMembership
    public function get($id)
    {
        $models = $this->getMembers();
        if (isset($models[$id])) {
            return $models[$id];
        }
        foreach ($models as $key => $membership) {
            if (in_array($id, [$membership->getSite()->id, $membership->getSite()->get('name')])) {
                return $membership;
            }
        }
        throw new TerminusNotFoundException('A site identified by {id} could not be found belonging to this organization.', compact('id'));
    }