当前位置: 首页>>代码示例>>PHP>>正文


PHP Customers::fetchAll方法代码示例

本文整理汇总了PHP中Customers::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::fetchAll方法的具体用法?PHP Customers::fetchAll怎么用?PHP Customers::fetchAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Customers的用法示例。


在下文中一共展示了Customers::fetchAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 /**
  * View a list of all customers
  */
 public function indexAction()
 {
     $customersTable = new Customers();
     $this->view->customers = $customersTable->fetchAll();
 }
开发者ID:carriercomm,项目名称:billing-6,代码行数:8,代码来源:CustomersController.php

示例2: getNewInvoiceForm

 private function getNewInvoiceForm(array $values = null)
 {
     $customersTable = new Customers();
     $customers = $customersTable->fetchAll();
     $customerList = array();
     if ($customers->count() > 0) {
         foreach ($customers as $c) {
             $customerList[$c->customer_id] = $c->company;
         }
     }
     $form = new Zend_Form();
     $form->setAction('/invoices/save')->setMethod('post');
     $customer = new Zend_Form_Element_Select('customer');
     $customer->addMultiOptions($customerList)->setLabel('Customer');
     $invoiceDate = new Zend_Form_Element_Text('invoice_date');
     $invoiceDate->setRequired(true)->setLabel('Invoice Date')->addValidator(new Zend_Validate_Date())->setAttrib('class', 'date')->setValue(date('Y-m-d'));
     $dueDate = new Zend_Form_Element_Text('due_date');
     $dueDate->setRequired(true)->setLabel('Due Date')->addValidator(new Zend_Validate_Date())->setAttrib('class', 'date')->setValue(date('Y-m-d', strtotime('+1 month')));
     $notes = new Zend_Form_Element_Textarea('notes');
     $notes->setLabel('Notes');
     $submit = new Zend_Form_Element_Submit('submit');
     if (isset($values)) {
         $customer->setValue($values['customer_id']);
         $invoiceDate->setValue($values['invoice_date']);
         $dueDate->setValue($values['due_date']);
         $notes->setValue($values['notes']);
     }
     $form->addElement($customer)->addElement($invoiceDate)->addElement($dueDate)->addElement($notes)->addElement($submit);
     return $form;
 }
开发者ID:carriercomm,项目名称:billing-6,代码行数:30,代码来源:InvoicesController.php


注:本文中的Customers::fetchAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。