多个条件搜索查询构建器[symfony2]

I have created a search form,i'm trying to fetch the following data from the database (airport,airport1,departuredate,price),i can only get [airport] but not the other entity.

This is my controller:

public function searchtabflightResultAction(Request $request)
{


    $form = $this->createForm(new SearchflightType());

    if ($this->get('request')->getMethod() == 'POST')
    {
        $form->handleRequest($request);

    $em = $this->getDoctrine()->getManager();
    $entities = $em->getRepository('FLYBookingsBundle:Post')->searchflight($form['airport']->getData());

    } else {
        throw $this->createNotFoundException('The page you were looking for doesn\'t exist.');
    }

    return $this->render('FLYBookingsBundle:Post:searchtabflightResult.html.twig', array('entities' => $entities));
}

PostRepository.php

public function searchflight($entity)
    {
        $qb = $this->createQueryBuilder('u')
            ->select('u')
            ->where('u.airport like :entity')
            ->andWhere('u.airport1 like :entity')
            ->orderBy('u.id')
            ->setParameter('entity', '%'.$entity.'%');
        return $qb->getQuery()->getResult();
    }

Try something like :

In your controller:

$entities = $em->getRepository('FLYBookingsBundle:Post')->searchflight($form);

In your repo:

public function searchflight(FormInterface $form)
{
    $qb = $this->createQueryBuilder('u');

    if ($form->has('airport')) {
        $qb->andWhere(
            $qb->expr()->like('u.airport', ':airport')
        )
           ->setParameter('airport', '%'. $form->get('airport')->getData().'%')
    }

    // ... complete like this with the other params