Dynamic Resource Mapper for Get Resource

@param string $resourceId Dynamic Resource ID to generate

@return array|null
334081
protected function dynamicResourceMapper($resourceId)
    {
        // Page Resource Mapper
        $resource = $this->pageResourceMapper($resourceId);

        if (!empty($resource)) {
            return $resource;
        }

        $resource = $this->siteResourceMapper($resourceId);

        if (!empty($resource)) {
            return $resource;
        }

        return null;
    }
845854
public void setResourceId(java.util.Collection<StringFilter> resourceId) {
        if (resourceId == null) {
            this.resourceId = null;
            return;
        }

        this.resourceId = new java.util.ArrayList<StringFilter>(resourceId);
    }
710718
public function getItem(string $resourceClass, $id, string $operationName = null, array $context = [])
    {
        /** @var ObjectManager $manager */
        $manager = $this->managerRegistry->getManagerForClass($resourceClass);

        if (!\is_array($id) && !($context[IdentifierConverterInterface::HAS_IDENTIFIER_CONVERTER] ?? false)) {
            $id = $this->normalizeIdentifiers($id, $manager, $resourceClass);
        }

        $fetchData = $context['fetch_data'] ?? true;
        if (!$fetchData && $manager instanceof EntityManagerInterface) {
            return $manager->getReference($resourceClass, $id);
        }

        $repository = $manager->getRepository($resourceClass);
        if (!method_exists($repository, 'createQueryBuilder')) {
            throw new RuntimeException('The repository class must have a "createQueryBuilder" method.');
        }

        $queryBuilder = $repository->createQueryBuilder('o');
        $queryNameGenerator = new QueryNameGenerator();
        $doctrineClassMetadata = $manager->getClassMetadata($resourceClass);

        $this->addWhereForIdentifiers((array) $id, $queryBuilder, $doctrineClassMetadata);

        foreach ($this->itemExtensions as $extension) {
            $extension->applyToItem($queryBuilder, $queryNameGenerator, $resourceClass, $id, $operationName, $context);

            if ($extension instanceof QueryResultItemExtensionInterface && $extension->supportsResult($resourceClass, $operationName, $context)) {
                return $extension->getResult($queryBuilder, $resourceClass, $operationName, $context);
            }
        }

        return $queryBuilder->getQuery()->getOneOrNullResult();
    }
560724
protected function getSitePagesResourceId($siteId)
    {
        /** @var ResourceName $resourceName */
        $resourceName = $this->getServiceLocator()->get(
            ResourceName::class
        );

        return $resourceName->get(
            ResourceName::RESOURCE_SITES,
            $siteId,
            ResourceName::RESOURCE_PAGES
        );
    }
49665
public function get($id)
    {
        if (!$this->isAllowed(RcmUserAclResourceProvider::RESOURCE_ID_ACL, 'read')) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        $rcmUserService = $this->getRcmUserService();

        $requestUser = $rcmUserService->buildNewUser();

        $requestUser->setId($id);

        $userResult = $rcmUserService->readUser($requestUser);

        if (!$userResult->isSuccess()) {
            return new ApiJsonModel(
                null,
                1,
                "User was not found with id {$id}."
            );
        }

        $user = $userResult->getUser();

        $resourceId = $this->getRequestResourceId();
        $privileges = $this->getRequestPrivileges();

        $apiResponse = [
            'hasAccess' => $rcmUserService->isUserAllowed(
                $resourceId,
                $privileges,
                null,
                $user
            ),
            'resourceId' => $resourceId,
            'privileges' => $privileges,
            // 'user' => $user,
            'userRoles' => $user->getProperty(UserRoleProperty::PROPERTY_KEY)
        ];

        return new ApiJsonModel($apiResponse, 0, 'Success');
    }
284785
public function getById($id)
    {
        $group = new Group(
            $this->getContext(),
            new ResourcePathServiceOperation($this->getContext(), $this->getResourcePath(), "getById", array($id))
        );
        return $group;
    }
200086
public function show($resourceId, $childResouceId)
    {
        $parameters = $this->request->getParameters();
        $model = $this->repository
        ->setResource($resourceId)
        ->setRelation($this->relation())
        ->getItem($childResouceId, $parameters);
        return $this->modelResponse($model);
    }
365149
public function get($regionId)
    {
        $resource = 'georegion/' . $regionId . '.json';
        $response = $this->getServiceResponse($resource);

        $geoRegion = new Models\ResponseGeoRegionGet($response);

        return $geoRegion;
    }
1086311
private function getResourceFromNode(ResourceNode $resourceNode)
    {
        /** @var AbstractResource $resource */
        $resource = $this->om
            ->getRepository($resourceNode->getClass())
            ->findOneBy(['resourceNode' => $resourceNode]);

        return $resource;
    }
701463
protected function buildUserResourceUri($resource, $userId = null)
    {

        $userId = is_null($userId) ? $this->userId : $userId;
        return '/users/' . $userId . '/' . $resource;

    }
62220
public function get($mediaId)
    {
        $node     = 'get';
        $queryStr = ['media_id' => $mediaId];

        $res = $this->_get($node, $queryStr);

        return $res;
    }
450360
public function configFor($resourceName, $resourceId = null)
    {
        foreach ($this->providers as $provider) {
            try {
                // Throw NotFound even if other providers dont
                if (!$config = $provider->configFor($resourceName, $resourceId)) {
                    continue;
                }

                return $config;
            } catch (NotFound $e) {
            }
        }

        throw new ResourceNotFoundException("No provider found a config found for '$resourceName' and id '$resourceId'");
    }
903565
public function resourceLinkMeta(string $type, string $id): array
    {
        foreach ($this->resourceMap as $resourceLink) {
            if (isset($resourceLink["meta"]) && $resourceLink["type"] === $type && $resourceLink["id"] === $id) {
                return $resourceLink["meta"];
            }
        }

        return [];
    }
115958
public function getLinkId($consumerId, $resourceLink)
    {
        $class = $this->getClass(self::CLASS_LTI_INCOMINGLINK);
        // search for existing resource
        $instances = $class->searchInstances(array(
            self::PROPERTY_LINK_ID => $resourceLink,
            self::PROPERTY_CONSUMER => $consumerId
        ), array('like' => false,'recursive' => false));
        if (count($instances) > 1) {
            throw new \common_exception_Error('Multiple resources for link ' . $resourceLink);
        }
        if (count($instances) == 1) {
            // use existing link
            $ltiLink = current($instances);
        } else {
            // spawn new link
            $ltiLink = $class->createInstanceWithProperties(array(
                self::PROPERTY_LINK_ID => $resourceLink,
                self::PROPERTY_CONSUMER => $consumerId
            ));
        }
        return $ltiLink->getUri();
    }
1117233
public static Uri getUriForResourceId(int resourceId) {
    return new Uri.Builder()
        .scheme(LOCAL_RESOURCE_SCHEME)
        .path(String.valueOf(resourceId))
        .build();
  }
1118154
public function resourceFor($resourceName)
    {
        $resourceConfig = $this->config->resourceConfigurationFor($resourceName);

        return $this->newResource($resourceConfig);
    }
425166
@Override
	@Transactional
	public String getResource(String id)
	{
		final TemplateCall call = templater.template("resource_template");

		final ResourceTemplateEntity entity = resourceProvisionService.getOrCreateTemplate(id);

		if (entity == null)
			throw new RestException(404, "No such resource with id: " + id);

		call.set("entity", entity);
		call.set("nonce", nonceStore.getValue());

		return call.process();
	}