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

get() public method

Retrieves the membership of the given UUID or email
public get ( string $id ) : SiteUserMembership
$id string UUID or email of desired user
return SiteUserMembership
    public function get($id)
    {
        $models = $this->getMembers();
        if (isset($models[$id])) {
            return $models[$id];
        }
        foreach ($models as $model) {
            $user = $model->getUser();
            if (in_array($id, [$user->get('email'), $user->get('profile')->full_name])) {
                return $model;
            }
        }
        throw new TerminusNotFoundException('Cannot find site user with the name "{id}"', compact('id'));
    }
SiteUserMemberships