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

get() public method

Retrieves models by either upstream ID or name
public get ( string $id ) : Upstream
$id string Either an upstream ID or an upstream name
return Upstream
    public function get($id)
    {
        $models = $this->getMembers();
        if (isset($models[$id])) {
            return $models[$id];
        }
        foreach ($models as $model) {
            if ($model->get('longname') == $id) {
                return $model;
            }
        }
        throw new TerminusNotFoundException('An upstream identified by "{id}" could not be found.', compact('id'));
    }
Upstreams