Example #1
0
 /**
  * 获取页面列表
  * 
  * 根据条件获取多条页面数据
  * 
  * @param unknown_type $where
  * @param string $order
  * @param int $limit
  */
 public function getPages($where = null, $order = null, $paginator = true, $limit = null)
 {
     $select = $this->select();
     if (is_string($where)) {
         $select->where($where);
     }
     if (is_array($where) & count($where) > 0) {
         foreach ($where as $key => $value) {
             $select->where($key . '=?', $value);
         }
     }
     if ($order) {
         $select->order($order);
     }
     if ($limit) {
         $select->limit($limit);
     }
     if ($paginator == false) {
         $result = $this->fetchAll($select);
     } else {
         $result = new Zend_Paginator_Adapter_DbTableSelect($select);
     }
     if ($result->count() > 0) {
         return $result;
     } else {
         return null;
     }
 }