public function getChildrenAction(Tag $tag = null, $isRoot = false)
    {
        $this->denyAccessUnlessGranted('ez:tags:read');

        $result = [];

        if ((bool) $isRoot) {
            $result[] = $tag instanceof Tag ?
                $this->getTagTreeData($tag, $isRoot) :
                $this->getRootTreeData();
        } else {
            $childrenTags = $this->tagsService->loadTagChildren($tag);
            foreach ($childrenTags as $tag) {
                $result[] = $this->getTagTreeData($tag, $isRoot);
            }
        }

        return (new JsonResponse())->setData($result);
    }