File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/Subscription/Controller Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 77use Doctrine \ORM \EntityManagerInterface ;
88use OpenApi \Attributes as OA ;
99use PhpList \Core \Domain \Subscription \Model \SubscriberAttributeDefinition ;
10+ use PhpList \Core \Domain \Subscription \Repository \SubscriberAttributeDefinitionRepository ;
1011use PhpList \Core \Domain \Subscription \Service \Manager \AttributeDefinitionManager ;
1112use PhpList \Core \Security \Authentication ;
1213use PhpList \RestBundle \Common \Controller \BaseController ;
@@ -343,6 +344,13 @@ public function getAttributeDefinition(
343344 throw $ this ->createNotFoundException ('Attribute definition not found. ' );
344345 }
345346
347+ /** @var SubscriberAttributeDefinitionRepository $repo */
348+ $ repo = $ this ->entityManager ->getRepository (SubscriberAttributeDefinition::class);
349+ $ hydrated = $ repo ->findOneByName ($ attributeDefinition ->getName ());
350+ if ($ hydrated instanceof SubscriberAttributeDefinition) {
351+ $ attributeDefinition = $ hydrated ;
352+ }
353+
346354 return $ this ->json (
347355 $ this ->normalizer ->normalize ($ attributeDefinition ),
348356 Response::HTTP_OK
You can’t perform that action at this time.
0 commit comments