I am trying to create a search box for a page with rejected transactions in our web application project, I am using the symfony2 framework, I am stuck, there was an error message,
'[Semantic error] line 0, col 235 next to' b JOIN b.ediAk403ErrorCodes ': Error: The class matrix \ MatrixEdiBundle \ Entity \ EdiTransaction does not have an association with the name edi997Details'
and
'CRITICAL - Untrained doctrine of exceptions PHP \ ORM \ Query \ QueryException: "[Semantical Error] line 0, col 235 next to' b JOIN b.ediAk403ErrorCodes': error: Class matrix \ MatrixEdiBundle \ Entity \ EdiTransaction has no association with the name edi997Dets "on /tmxpage/apache/htdocsEDI/Editracker/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php line 63 '
here is my code for this (in my repository):
public function getDetails($gsNumber, $senderId, $receiverId, $page = 1, $limit = 5 ){
$em = $this->getEntityManager();
$query = $em->createQuery(
'SELECT partial a.{ediTransactionId, senderId, receiverId, gsNumber, isaNumber, fileName },
partial b.{errorCodeId, noOfTrans},
partial c.{errorCode, condition}
FROM MatrixEdiBundle:EdiTransaction a
JOIN a.edi997Details b
JOIN b.ediAk403ErrorCodes c
WHERE b.errorCodeId != 1
AND a.flag = 1
AND a.gsNumber LIKE :gsNumber
AND a.senderId LIKE :senderId
AND a.recieverId LIKE :receiverId')
->setParameter('gsNumber', "%gsNumber%")
->setParameter('senderId', "%senderId%")
->setParameter('receiverId'ssss, "%receiverId%")
->setFirstResult(($page-1)*$limit)
->setMaxResults($limit);
$paginator = new Paginator($query, $fetchJoinCollection = false );
$paginator->setUseOutputWalkers(false);
return $paginator;
}
and here is my entity code for talble ediAk403ErrorCodes:
class EdiAk403ErrorCodes
{
private $condition;
private $errorCode;
public function setCondition($condition)
{
$this->condition = $condition;
return $this;
}
public function getCondition()
{
return $this->condition;
}
public function getErrorCode()
{
return $this->errorCode;
}
public function getEdi997Details()
{
return $this->edi997Details;
}
}