|
@@ 95-102 (lines=8) @@
|
| 92 |
|
/** |
| 93 |
|
* {@inheritdoc} |
| 94 |
|
*/ |
| 95 |
|
public function getIriFromResourceClass(string $resourceClass, int $referenceType = UrlGeneratorInterface::ABS_PATH): string |
| 96 |
|
{ |
| 97 |
|
try { |
| 98 |
|
return $this->router->generate($this->routeNameResolver->getRouteName($resourceClass, OperationType::COLLECTION), [], $referenceType); |
| 99 |
|
} catch (RoutingExceptionInterface $e) { |
| 100 |
|
throw new InvalidArgumentException(sprintf('Unable to generate an IRI for "%s".', $resourceClass), $e->getCode(), $e); |
| 101 |
|
} |
| 102 |
|
} |
| 103 |
|
|
| 104 |
|
/** |
| 105 |
|
* {@inheritdoc} |
|
@@ 107-113 (lines=7) @@
|
| 104 |
|
/** |
| 105 |
|
* {@inheritdoc} |
| 106 |
|
*/ |
| 107 |
|
public function getItemIriFromResourceClass(string $resourceClass, array $identifiers, int $referenceType = UrlGeneratorInterface::ABS_PATH): string |
| 108 |
|
{ |
| 109 |
|
try { |
| 110 |
|
return $this->router->generate($this->routeNameResolver->getRouteName($resourceClass, OperationType::ITEM), $identifiers, $referenceType); |
| 111 |
|
} catch (RoutingExceptionInterface $e) { |
| 112 |
|
throw new InvalidArgumentException(sprintf('Unable to generate an IRI for "%s".', $resourceClass), $e->getCode(), $e); |
| 113 |
|
} |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
/** |
|
@@ 119-126 (lines=8) @@
|
| 116 |
|
/** |
| 117 |
|
* {@inheritdoc} |
| 118 |
|
*/ |
| 119 |
|
public function getSubresourceIriFromResourceClass(string $resourceClass, array $identifiers, int $referenceType = UrlGeneratorInterface::ABS_PATH): string |
| 120 |
|
{ |
| 121 |
|
try { |
| 122 |
|
return $this->router->generate($this->routeNameResolver->getRouteName($resourceClass, OperationType::SUBRESOURCE), $identifiers, $referenceType); |
| 123 |
|
} catch (RoutingExceptionInterface $e) { |
| 124 |
|
throw new InvalidArgumentException(sprintf('Unable to generate an IRI for "%s".', $resourceClass), $e->getCode(), $e); |
| 125 |
|
} |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
/** |
| 129 |
|
* Find identifiers from an Item (Object). |