1

I've build a pagination in Zend framework 1.12 using native query like

$nativeQuery = $em->createNativeQuery("SELECT u.*,l.* FROM `table1` u INNER JOIN `table2` l ON u.`x`=l.`y` WHERE l.`ub_id`='10'", $rsm); 

given rsm as,

$rsm = new ResultSetMapping();          
$rsm->addEntityResult('Models\objectname1(table1)', 'su');    
$rsm->addFieldResult('su', 'x', 'xx');      
$rsm->addFieldResult('su', 'y','yy');           
$rsm->addJoinedEntityResult('Models\objectname2(table2)', 'sul', 'su', 'x');          
$rsm->addFieldResult('sul', 'xid', 'idx');

I've run the same query in db and got more than 1 rows. But the value of paginator array is null what is the issue.

I have referred this . but not working for me.

Community
  • 1
  • 1
Anish Abraham
  • 255
  • 4
  • 20

1 Answers1

0

Your code looks good. Please check whether you have properly called entityManager

$this->getDoctrine()->getManager()
Geo Tom
  • 270
  • 3
  • 16