code: public function getHome()
      {
          $query = $this->createQueryBuilder('c')
              ->join('c.forums', 'f')
              ->join('f.lastMessage', 'm')
              ->join('m.user', 'u')
              ->addSelect('f')
              ->addSelect('m')
              ->addSelect('u')
              ->where('f.status = :status')
              ->setParameter('status', Forum::STATUS_PUBLIC);
  
          $query->orderBy('c.position', 'ASC')
              ->addOrderBy('f.position', 'ASC');
  
  
          return $query->getQuery();
      }
docs: Finds category with forum
  
  
  @return \Doctrine\ORM\Query