當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Reservation::findAll方法代碼示例

本文整理匯總了PHP中Reservation::findAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reservation::findAll方法的具體用法?PHP Reservation::findAll怎麽用?PHP Reservation::findAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Reservation的用法示例。


在下文中一共展示了Reservation::findAll方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: indexAction

 public function indexAction()
 {
     $user = Zend_Auth::getInstance()->getIdentity()->user;
     $calendar = new App_JqCalendar();
     $calendar->defaultView();
     $calendar->currentFirstDay(true);
     $calendar->canAddAllDay(false);
     // add reservations only if the user have aircrafts
     if (count($user->Aircraft->toArray()) > 0) {
         $calendar->enableAdd(true);
     } else {
         $calendar->enableAdd(false);
     }
     if (Zend_Auth::getInstance()->getIdentity()->isAdmin) {
         $this->_addHeadTitle("All reservations");
         $reservations = Reservation::findAll();
         $this->view->events = Reservation::toEvents($reservations, true);
         $calendar->loadUrl($this->baseUrl . "/index/index/format/json");
     } else {
         $this->_addHeadTitle("My reservations");
         $reservations = Reservation::findByUser($user->id);
         $this->view->events = Reservation::toEvents($reservations);
         $calendar->loadUrl($this->baseUrl . "/index/index/format/json");
     }
     $this->view->jqCalendar = $calendar;
 }
開發者ID:edderrd,項目名稱:Aerocal,代碼行數:26,代碼來源:IndexController.php

示例2: indexAction

 public function indexAction()
 {
     //$fc = new App_Fullcalendar();
     //$fc->selectable(false)->editable(false);
     $user = Zend_Auth::getInstance()->getIdentity()->user;
     if (Zend_Auth::getInstance()->getIdentity()->isAdmin) {
         $this->_addHeadTitle("All reservations");
         $this->view->reservations = Reservation::findAll();
         //$fc->addEvents(Reservation::toEvents($this->view->reservations, true));
     } else {
         $this->_addHeadTitle("My reservations");
         $this->view->reservations = Reservation::findByUser($user->id);
         //$fc->addEvents(Reservation::toEvents($this->view->reservations));
     }
     //$this->view->fc = $fc;
 }
開發者ID:secretgspot,項目名稱:Aerocal,代碼行數:16,代碼來源:IndexController.php


注:本文中的Reservation::findAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。