main/core/Controller/APINew/WidgetController.php
public function listAction($context = null)
    {
        return new JsonResponse([
            'widgets' => array_map(function (Widget $widget) {
                return $this->serializer->serialize($widget);
            }, $this->widgetManager->getAvailable($context)),
            'dataSources' => array_map(function (DataSource $dataSource) {
                return $this->serializer->serialize($dataSource);
            }, $this->dataSourceManager->getAvailable($context)),
        ]);
    }
public function listAction($context = null)
    {
        return new JsonResponse([
            'widgets' => array_map(function (Widget $widget) {
                return $this->serializer->serialize($widget);
            }, $this->widgetManager->getAvailable($context)),
            'dataSources' => array_map(function (DataSource $dataSource) {
                return $this->serializer->serialize($dataSource);
            }, $this->dataSourceManager->getAvailable($context)),
        ]);
    }
public function listAction ( $ context = null ) { return new JsonResponse ( [ 'widgets' => array_map ( function ( Widget $ widget ) { return $ this -> serializer -> serialize ( $ widget ) ; } , $ this -> widgetManager -> getAvailable ( $ context ) ) , 'dataSources' => array_map ( function ( DataSource $ dataSource ) { return $ this -> serializer -> serialize ( $ dataSource ) ; } , $ this -> dataSourceManager -> getAvailable ( $ context ) ) , ] ) ; }
Lists available widgets for a given context.

@EXT\Route("/{context}", name="apiv2_widget_available", defaults={"context"=null})
@EXT\Method("GET")

@param string $context

@return JsonResponse
Lists available widgets for a given context .