我的代码出了什么问题?

时间:2016-03-22 04:07:31

标签: php mysql sql symfony

我有这样的代码,symfony中的错误说:

  

[语义错误]第0行,第221行靠近'b

     

WHERE':错误:Class Matrix \ MatrixEdiBundle \ Entity \ EdiTransaction没有名为ediTransaction的关联

这是我的代码:

class Edi997DetailsRepository extends EntityRepository

{
    public function getDetails($gsNumber, $senderId, $receiverId,$page = 1, $limit = 5 ){
            $em = $this->getEntityManager();
            $query = $em->createQuery(
                     'SELECT partial a.{ediTransactionId, gsNumber, senderId, receiverId, isaNumber, fileName},

        partial b.{ediTransactionId}

        FROM MatrixEdiBundle:EdiTransaction a

        JOIN a.ediTransaction b

                    WHERE b.errorCodeId != 1
                    AND a.flag = 1
                    AND a.gsNumber LIKE :gsNumber
                    AND a.senderId LIKE :senderId
                    AND a.receiverId LIKE :receiverId
                    ')

                    ->setFirstResult(($page-1)*$limit)

                    ->setMaxResults($limit);



                    $paginator = new Paginator($query, $fetchJoinCollection = false );

                    $paginator->setUseOutputWalkers(false);


            return $paginator;
    }
}

?>

0 个答案:

没有答案