Example #1
0
 /**
  * Displays a list of customers.
  *
  * @return void
  */
 public function action_index()
 {
     $args = array('seller' => Seller::active(), 'status' => 'all');
     $pagination = Pagination::forge('customer_pagination', array('total_items' => Service_Customer::count($args)));
     $customers = Service_Customer::find(array_merge($args, array('offset' => $pagination->offset, 'limit' => $pagination->per_page)));
     $this->view->customers = $customers;
     $this->view->pagination = $pagination;
 }
Example #2
0
 /**
  * Gets one or more customers.
  *
  * @param int $id Customer ID.
  *
  * @return void
  */
 public function get_index($id = null)
 {
     $seller = \Seller::active();
     if (!$id) {
         $customers = \Service_Customer::find(array('seller' => $seller));
     } else {
         $customers = $this->get_customer($id);
     }
     $this->response($customers);
 }