public function listAction(Request $request)
 {
     $repo = $this->get('wucdbm_banner.repo.banner_positions');
     $filter = new BannerPositionFilter();
     $pagination = $filter->getPagination()->enable();
     $filterForm = $this->createForm(BannerPositionFilterType::class, $filter);
     $filter->load($request, $filterForm);
     $positions = $repo->filter($filter);
     $data = ['positions' => $positions, 'filter' => $filter, 'pagination' => $pagination, 'filterForm' => $filterForm->createView()];
     return $this->render('@WucdbmBanner/BannerPosition/list.html.twig', $data);
 }
 /**
  * @param BannerPositionFilter $filter
  * @return BannerPosition[]
  */
 public function filter(BannerPositionFilter $filter)
 {
     $builder = $this->createQueryBuilder('p')->addSelect('b')->leftJoin('p.banner', 'b');
     if ($filter->getId()) {
         $builder->andWhere('p.id = :id')->setParameter('id', $filter->getId());
     }
     if ($filter->getName()) {
         $builder->andWhere('p.name = :name')->setParameter('name', $filter->getName());
     }
     if (null !== $filter->getIsActive()) {
         $builder->andWhere('p.isActive = :isActive')->setParameter('isActive', $filter->getIsActive());
     }
     return $this->returnFilteredEntities($builder, $filter, 'p.id');
 }