/** * Get the project associated with this subscription. * * @return Project|false */ public function getProject() { if (!$this->hasLink('project') && !$this->isActive()) { throw new \BadMethodCallException('Inactive subscriptions do not have projects.'); } $url = $this->getLink('project'); return Project::get($url, null, $this->client); }
/** * Get a single project at a known location. * * @param string $id The project ID. * @param string $hostname The hostname of the Platform.sh regional API, * e.g. 'eu.platform.sh' or 'us.platform.sh'. * @param bool $https Whether to use HTTPS (default: true). * * @return Project|false */ public function getProjectDirect($id, $hostname, $https = true) { $scheme = $https ? 'https' : 'http'; $collection = "{$scheme}://{$hostname}/api/projects"; return Project::get($id, $collection, $this->connector->getClient()); }