Locate a project by ID.

@param string $id
The project ID.

@return string
The project's API endpoint.
330792
protected function locateProject($id)
    {
        $url = $this->accountsEndpoint . 'projects/' . rawurlencode($id);
        try {
            $result = $this->simpleGet($url);
        }
        catch (BadResponseException $e) {
            $response = $e->getResponse();
            // @todo Remove 400 from this array when the API is more liberal in validating project IDs.
            $ignoredErrorCodes = [400, 403, 404];
            if ($response && in_array($response->getStatusCode(), $ignoredErrorCodes)) {
                return false;
            }
            throw ApiResponseException::create($e->getRequest(), $e->getResponse(), $e->getPrevious());
        }

        return isset($result['endpoint']) ? $result['endpoint'] : false;
    }
113915
public function findById($id)
    {
        $id = $this->getRepository()->idToMongo($id);
        return $this->mergeCriteria(array('_id' => $id));
    }
448905
public function findOneById($id) {
		$response = $this->get($this->baseUri . 'show.json', array('id' => $id));

		return $this->mapResponseToObjects($response, Tweet::class);
	}
556167
public function findById($id)
    {
        if (!isset($id) || is_null($id)) {
            return null;
        }
        $builder = $this->em->createQueryBuilder();

        $tag = $builder
            ->select('t')
            ->from($this->tagClass, 't')

            ->where($builder->expr()->eq('t.id', $id))

            ->getQuery()
            ->getOneOrNullResult();

        return $tag;
    }
1291795
public function getDMById($id)
    {
        return $this->getDMs()->then(function (array $dms) use ($id) {
            foreach ($dms as $dm) {
                if ($dm->getId() === $id) {
                    return $dm;
                }
            }

            throw new ApiException('DM ' . $id . ' not found.');
        });
    }
269450
public function projectCount($id) {
        // I know eloquent does this, but having trouble so hand crafting using DB
        $record =  DB::table('projects')->where('status_id', '=', $id)->get();
        return count($record);
    }
994970
public function get($id)
    {
        $site = $this->getCurrentSite();

        $result = $this->buildSiteApiResponse($site);

        return new ApiJsonModel($result, 0, 'Success');
    }
1343314
public function find($id)
    {
        if (! is_numeric($id) && is_string($id)) {
            return $this->findBySlug($id);
        }

        return $this->plugger
            ->setModel($this)
            ->setAdapter(Post::class)
            ->plugIn(get_post($id))
            ->getConnected()
            ->first();
    }
712657
public function findById($id)
    {
        if (!array_key_exists($id, $this->bpmn2Files)) {
            return null;
        }

        $bpmn2Reader = new Bpmn2Reader();

        return $bpmn2Reader->read($this->bpmn2Files[$id]->getFile());
    }
750471
public function find($id)
    {
        $resourceName = constant($this->type . '::RESOURCE');

        $url      = sprintf("%s/%s/%s", self::ENDPOINT, $resourceName, $id);
        $response = $this->fetch($url, substr($resourceName, 0, strlen($resourceName) - 1));

        return new $this->type($response);
    }
1129449
public function show($id)
    {
        $projectConstructions = $this->client->get(
            sprintf('templates/%d/project_constructions/%d.json', $this->parent, $id)
        );

        return $this->response($projectConstructions);
    }
104691
public static function find($id)
	{
		$object = new static;
		$response = $object->request('GET', sprintf('%s/%s', $object->getUrl(), $id));

		return $response ? $object : false;
	}
1096093
public static function delete_endpoint($id) {
        require_capability('moodle/site:config', context_system::instance());
        $endpoint = new endpoint($id);

        // Will throw exceptions on validation failures.
        return $endpoint->delete();
    }
1160551
public function findOrFail($id)
    {
        return $this->cache->rememberForever('extension.' . $id, function () use ($id){
            return $this->repository->findOrFail($id);
        });
    }
894468
protected function topicsEndpoint($id = null)
    {
        return $id === null ? $this->topicsEndpoint : $this->topicsEndpoint . '/' . $id;
    }
802979
public function show($id)
    {
        $project = $this->client->get(sprintf('projects/%d.json', $id));

        return new Project($this->response($project));
    }
731269
public function get(int $id): Agenda
    {
        return $this->getClient()->call(null, $id, self::ENDPOINT, Agenda::class, false, 'GET');
    }