0

when i define a parameter in the given section its give me error that this "tt" parameter is undefine. i do not know what is the problem. it give me this error

Notice: Undefined property: Doctrine\ORM\QueryBuilder::$SELECT u1.unitid, m1.id FROM ApiMapBundle:Mappaths m1 INNER JOIN ApiMapBundle:Unitids u1 WITH m1.refUnitids2 = u1.id OR m1.refUnitids1 = u1.id WHERE m1.id=:tt

             $cn=2;
            $qb = $em->createQueryBuilder();

            $query = $qb->select('u1.unitid','m1.id')
                    ->from('ApiMapBundle:Mappaths', 'm1')
                    ->join('ApiMapBundle:Unitids', 'u1', 'WITH', $qb->expr()->orX('m1.refUnitids2 = u1.id', 'm1.refUnitids1 = u1.id'))
                    ->andWhere('m1.id=:tt')
                     ->$qb->setParameter('tt', $cn)
                    ->getQuery()

                    ->getResult();
           return $query;

any idea?

zahid
  • 113
  • 12

1 Answers1

0

Try removing ->$qb from ->$qb->setParameter('tt', $cn)

marian0
  • 664
  • 6
  • 15