zend-frameworkzend-dbzend-db-table

How to fetch many rows order by a specific value


by using zend 1.12 how to order the data fetched by, a specific entry first. (order by) how to make the last option for ex 'Bioversity International' be the first one beside the where clause a written below .

$_partnerMapper = new Model_Mapper_Partner();
$_partnerCollection = $_partnerMapper->fetchMany(array('partner_type_id'=>9));
$this->view->partnerCollection = $_partnerCollection;

Solution

  • this is not zend 1.12 its something outside zend but its like the following

    fetchMany($criteria=null,$order=null,$count=null,$offset=-1)

    so what you need to do is $_partnerMapper->fetchMany(array('partner_type_id'=>9),'partner_type_id ASC');