diff --git a/src/ApiResource/Matchfunding/MatchStrategyApiResource.php b/src/ApiResource/Matchfunding/MatchStrategyApiResource.php new file mode 100644 index 0000000..6e9399a --- /dev/null +++ b/src/ApiResource/Matchfunding/MatchStrategyApiResource.php @@ -0,0 +1,20 @@ +matchStrategyLocator->get($uriVariables['name']); + + return $this->getApiResource($strategy); + } catch (MatchStrategyNotFoundException $e) { + return null; + } + } + + $strategies = $this->matchStrategyLocator->getAll(); + + $resources = []; + foreach ($strategies as $strategy) { + $resources[] = $this->getApiResource($strategy); + } + + return $resources; + } + + private function getApiResource(MatchStrategyInterface $strategy): MatchStrategyApiResource + { + $resource = new MatchStrategyApiResource(); + $resource->name = $strategy::getName(); + + return $resource; + } +}