render = $render; } public function normalize($socialIssue, string $format = null, array $context = []) { /** @var SocialIssue $socialIssue */ return [ 'type' => 'social_issue', 'id' => $socialIssue->getId(), 'parent_id' => $socialIssue->hasParent() ? $socialIssue->getParent()->getId() : null, 'children_ids' => $socialIssue->getChildren()->map(function (SocialIssue $si) { return $si->getId(); }), 'title' => $socialIssue->getTitle(), 'text' => $this->render->renderString($socialIssue, []) ]; } public function supportsNormalization($data, string $format = null): bool { return $data instanceof SocialIssue; } }