Get Custom Model Collection According to Page Number and Page Size..(In Magento )
//salesperson is a custom model in magento
$pagenum=5;// pagenumber which you data want
$pagesize=10;// how many data display on a page
$collection=Mage::getModel('salesperson/salesperson')->getCollection();
$collection->addFieldtoFilter('phone2',array('eq'=>''));// condition for filter data
$collection->setCurPage($pagenum);
$collection->setPageSize($pagesize);
foreach($collection as $t){
echo $t->geCity();
}
Categories:
magento
View Comments
Comment or Ask a Question
Quick Links