original_string: public function childElementtypesAction(Request $request)
      {
          $id = $request->get('id');
  
          $elementSourceManager = $this->get('phlexible_element.element_source_manager');
          $elementService = $this->get('phlexible_element.element_service');
          $iconResolver = $this->get('phlexible_element.icon_resolver');
  
          $elementtype = $elementSourceManager->findElementtype($id);
          $childElementtypes = $elementService->findAllowedChildren($elementtype);
  
          $data = [];
          foreach ($childElementtypes as $childElementtype) {
              $data[$childElementtype->getTitle().$childElementtype->getId()] = [
                  'id' => $childElementtype->getId(),
                  'title' => $childElementtype->getTitle(),
                  'icon' => $iconResolver->resolveElementtype($childElementtype),
              ];
          }
          ksort($data);
          $data = array_values($data);
  
          return new JsonResponse(['elementtypes' => $data]);
      }
code: public function childElementtypesAction(Request $request)
      {
          $id = $request->get('id');
  
          $elementSourceManager = $this->get('phlexible_element.element_source_manager');
          $elementService = $this->get('phlexible_element.element_service');
          $iconResolver = $this->get('phlexible_element.icon_resolver');
  
          $elementtype = $elementSourceManager->findElementtype($id);
          $childElementtypes = $elementService->findAllowedChildren($elementtype);
  
          $data = [];
          foreach ($childElementtypes as $childElementtype) {
              $data[$childElementtype->getTitle().$childElementtype->getId()] = [
                  'id' => $childElementtype->getId(),
                  'title' => $childElementtype->getTitle(),
                  'icon' => $iconResolver->resolveElementtype($childElementtype),
              ];
          }
          ksort($data);
          $data = array_values($data);
  
          return new JsonResponse(['elementtypes' => $data]);
      }
code_tokens: public function childElementtypesAction ( Request $ request ) { $ id = $ request -> get ( 'id' ) ; $ elementSourceManager = $ this -> get ( 'phlexible_element.element_source_manager' ) ; $ elementService = $ this -> get ( 'phlexible_element.element_service' ) ; $ iconResolver = $ this -> get ( 'phlexible_element.icon_resolver' ) ; $ elementtype = $ elementSourceManager -> findElementtype ( $ id ) ; $ childElementtypes = $ elementService -> findAllowedChildren ( $ elementtype ) ; $ data = [ ] ; foreach ( $ childElementtypes as $ childElementtype ) { $ data [ $ childElementtype -> getTitle ( ) . $ childElementtype -> getId ( ) ] = [ 'id' => $ childElementtype -> getId ( ) , 'title' => $ childElementtype -> getTitle ( ) , 'icon' => $ iconResolver -> resolveElementtype ( $ childElementtype ) , ] ; } ksort ( $ data ) ; $ data = array_values ( $ data ) ; return new JsonResponse ( [ 'elementtypes' => $ data ] ) ; }
docstring: List all element child elementtypes.
  
  @param Request $request
  
  @return JsonResponse
  @Route("/childelementtypes", name="teasers_layout_childelementtypes")
docstring_tokens: List all element child elementtypes .