zend framework

//获取页面
public function getPage($where=null,$order=null)
{
$select=$this->select();
if($order)
{
$select->order($order);
}
if($where==null)
{
$row=$this->fetchRow($select);
}
if(is_numeric($where))
{
$row=$this->find($where)->current();
}
if(is_string($where))
{
$select->where($where);
}
if(is_array($where) and count($where)>0)
{
foreach($where as $key=>$value)
{
$select->where($key.'?='.$value);
}
$row=$this->fetchRow($select);
}
if($row)
{
return $row;
}else
{
return null;
}
}

你可能感兴趣的:(zend framework)