public function getCategoryByUserSession(UserSessionInterface $userSession)
    {
        $configuration = $userSession->getConfiguration();
        $categories = $this->createQueryBuilder('c')
            ->select('c.name')
            ->where('c.id IN (:categories)')
            ->setParameter('categories', $configuration->getCategories())
            ->getQuery()
            ->getResult();

        $categories = array_map(function($category) {
            /** @var CategoryInterface $category */

            return $category->getName();
        }, $categories);

        return $categories;
    }
public function getCategoryByUserSession(UserSessionInterface $userSession)
    {
        $configuration = $userSession->getConfiguration();
        $categories = $this->createQueryBuilder('c')
            ->select('c.name')
            ->where('c.id IN (:categories)')
            ->setParameter('categories', $configuration->getCategories())
            ->getQuery()
            ->getResult();

        $categories = array_map(function($category) {
            /** @var CategoryInterface $category */

            return $category->getName();
        }, $categories);

        return $categories;
    }
public function getCategoryByUserSession ( UserSessionInterface $ userSession ) { $ configuration = $ userSession -> getConfiguration ( ) ; $ categories = $ this -> createQueryBuilder ( 'c' ) -> select ( 'c.name' ) -> where ( 'c.id IN (:categories)' ) -> setParameter ( 'categories' , $ configuration -> getCategories ( ) ) -> getQuery ( ) -> getResult ( ) ; $ categories = array_map ( function ( $ category ) { /** @var CategoryInterface $category */ return $ category -> getName ( ) ; } , $ categories ) ; return $ categories ; }
Get category list by questionnaire

@param UserSessionInterface $userSession

@return array
Get category list by questionnaire