public function get_gitlab_id()
{
$id = null;
$response = isset($this->response['project_id']) ? $this->response['project_id'] : false;
if (!$response) {
self::$method = 'projects';
$response = $this->api('/projects?per_page=100');
foreach ((array) $response as $project) {
if ($this->type->repo === $project->path) {
$id = $project->id;
$this->set_transient('project_id', $id);
$this->set_transient('project', $project);
return $id;
}
}
if (empty($response)) {
$id = urlencode($this->type->owner . '/' . $this->type->repo);
return $id;
}
}
return $response;
}