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


PHP Base::getModel方法代码示例

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


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

示例1: subs

 /**
  * Returns an object of Subs_Rowset of subs belonging to this brand
  *
  * @return object $this->_subs Subs_Rowset
  */
 public function subs()
 {
     if (!$this->_subs) {
         $subModel = Base::getModel('Subs');
         $select = $subModel->select()->where('brand_id = ?', $this->id);
         $this->_subs = $subModel->fetchAll($select);
     }
     return $this->_subs;
 }
开发者ID:roozbehmatloobi,项目名称:Zend-PHP,代码行数:14,代码来源:Row.php

示例2: indexAction

 /**
  * Display list of ACL Roles in the system.
  */
 public function indexAction()
 {
     $request = $this->getRequest();
     $acrModel = Base::getModel('AclRoles');
     $where = $acrModel->select()->order('id ASC');
     $paginator = Zend_Paginator::factory($where);
     $paginator->setItemCountPerPage(10);
     $paginator->setCurrentPageNumber($request->getParam('page'));
     $aclroles = $paginator;
     $this->view->aclroles = $aclroles;
 }
开发者ID:roozbehmatloobi,项目名称:Zend-PHP,代码行数:14,代码来源:AclRolesController.php

示例3: indexAction

 /**
  * Controller action to list brand code
  */
 public function indexAction()
 {
     $user = $this->loggedInUser();
     $request = $this->getRequest();
     $brnModel = Base::getModel('Brands');
     $select = $brnModel->select();
     $license_id = $request->getParam('license-id');
     if ($license_id) {
         $select->where('license_id = ?', $license_id);
     }
     $paginator = Zend_Paginator::factory($select);
     $paginator->setItemCountPerPage(10);
     $paginator->setCurrentPageNumber($request->getParam('page'));
     $brands = $paginator;
     $this->view->brands = $brands;
     $this->view->licenses = $user->licenses();
     // generate the license options
     $this->view->license_options = array_merge(array('' => 'All'), $user->licenses()->inSelect());
 }
开发者ID:roozbehmatloobi,项目名称:Zend-PHP,代码行数:22,代码来源:BrandsController.php

示例4: createDuplicateOrderAction

 function createDuplicateOrderAction()
 {
     // init paramaters
     $request = $this->getRequest();
     $user = $this->loggedInUser();
     // get the order records
     $order_number = $request->getParam('order_number');
     if ($order_number) {
         $ordModel = Base::getModel('Common_Orders');
         $select = $ordModel->select()->where('order_number = ?', $order_number);
         $order = $ordModel->fetchRow($select);
         if (!$order) {
             $this->addFlash('Invalid order', 'errors');
             return;
         }
     }
     $cart = Modules_Client_Cart::getInstance();
     $cart->setStorage('session');
     $cart->setCommonUserId($order->common_user_id);
     $duplicate_order_params = $cart->getDuplicateOrderParams();
     if (isset($duplicate_order_params['common_user_id'])) {
         $cuModel = Base::getModel('Common_Users');
         $common_user = $cuModel->fetchById($duplicate_order_params['common_user_id']);
     }
     $order_id = $cart->toOrder();
     if ($common_user->order_notify == 1) {
         $common_user->confirmemail($order_id);
     }
     //$this->log()->log('Order ID: ' .$order_id . ' : ' . $_SERVER['HTTP_USER_AGENT'] , Zend_Log::INFO);
     // clear the cart here
     $cart->clear();
     // redirect to payment option page
     $this->_redirect('/common/orders/edit/id/' . $order_id, array('exit' => true));
 }
开发者ID:roozbehmatloobi,项目名称:Zend-PHP,代码行数:34,代码来源:OrdersController.php

示例5: subscribeNewsletter

 /**
  * subscribe this use to the newsletter
  *
  * @return null
  */
 public function subscribeNewsletter()
 {
     // check if the user is already subscribed
     $subscription = $this->newsletterRecord();
     if ($subscription) {
         $subscription->resubscribe($this->first_name);
     } else {
         // create a new record
         $data = array('email' => $this->email, 'common_user_id' => $this->id, 'first_name' => $this->first_name, 'sub_id' => $this->sub_id);
         $nwlModel = Base::getModel('Newsletter');
         $created = $nwlModel->process($data, 'insert');
     }
     return;
 }
开发者ID:roozbehmatloobi,项目名称:Zend-PHP,代码行数:19,代码来源:Row.php

示例6: unUsedShipping

 /**
  * returns any un-used shipping records from this order. This is mainly based on any shipping that
  * belongs to this order but not assigned to any items and not marked as sent.
  *
  * @return object $unusedShipping Common_Orders_Shipping_Rowset
  */
 public function unUsedShipping()
 {
     // get all unused shipping
     $cosModel = Base::getModel('Common_Orders_Shipping');
     $select = $cosModel->select()->where('common_order_id = ?', $this->id)->where('date_sent IS NULL')->order('id DESC');
     // define and exclude assigned item shippings
     $db = Zend_Registry::get('db');
     $sql = $db->quoteInto("SELECT common_order_shipping_id FROM common_items WHERE common_order_id = ?", $this->id);
     $item_shipping_ids = $db->fetchCol($sql);
     if (!empty($item_shipping_ids)) {
         $select->where('id NOT IN (?)', $item_shipping_ids);
     }
     $shippings = $cosModel->fetchAll($select);
     return $shippings;
 }
开发者ID:roozbehmatloobi,项目名称:Zend-PHP,代码行数:21,代码来源:Row.php

示例7: array

#!/usr/bin/php5
<?php 
// include required files
include_once 'script_bootstrap.php';
// create new discount (certificate) record
$cdModel = Base::getModel('Client_Discounts');
$options = array('date_start' => '2012-11-01', 'date_end' => '2013-01-30');
// 139 vouchers with $30 value, Expiry date of 30/1/13
for ($count = 0; $count <= 139; $count++) {
    $discount = $cdModel->createNewGiftPackDiscount(NULL, 'PROMO $30', 1, 30.0, $options);
    $discount->generateGiftpackPDF();
    echo $discount->id . "\n";
}
// 40 vouchers with $25 value, Expiry date of 30/1/13
for ($count = 0; $count <= 40; $count++) {
    $discount = $cdModel->createNewGiftPackDiscount(NULL, 'PROMO $25', 1, 25.0, $options);
    $discount->generateGiftpackPDF();
    echo $discount->id . "\n";
}
echo "\nDone.\n";
开发者ID:roozbehmatloobi,项目名称:PHPscript-DB-report,代码行数:20,代码来源:bulk_giftpack.php

示例8: clearCartAction

 public function clearCartAction()
 {
     $request = $this->getRequest();
     $user_id = $request->getParam('user_id');
     $cuModel = Base::getModel('Common_Users');
     $select = $cuModel->select()->where('id = ?', $user_id);
     $common_user = $cuModel->fetchRow($select);
     $common_user->cart_data = '';
     $common_user->sub_id = $request->getParam('sub_id');
     $common_user->save();
     $this->addFlash('The cart data is cleared.', 'notice');
     $this->_redirect('/common/users/edit/id/' . $user_id, array('exit' => true));
 }
开发者ID:roozbehmatloobi,项目名称:Zend-PHP,代码行数:13,代码来源:UsersController.php

示例9: pendingOrdersAction

 public function pendingOrdersAction()
 {
     $this->_helper->viewRenderer->setNoRender(true);
     $this->getResponse()->setHeader('Content-Type', 'text/html');
     $cache = Zend_Registry::get('cache');
     $date_start = date('Y-m-d') . ' 00:00:00';
     $date_end = date('Y-m-d') . ' 23:59:59';
     $key = __METHOD__ . '_' . $date_start . '_' . $date_end . '_' . 'pendingOrders';
     $cache_key = Base_Utils_String::slug($key);
     if ($cache_date_end < date('Y-m-d', time()) && ($result = $cache->load($cache_key))) {
         $this->getResponse()->setBody(Zend_Json::encode($result));
         return;
     }
     // init variables
     $coModel = Base::getModel('Common_Orders');
     $select = $coModel->select()->setIntegrityCheck(false)->from(array('co' => 'common_orders'), array('count' => 'count(co.id)'))->where("co.status = 'PENDING'");
     $order = $coModel->fetchRow($select);
     if (!$order) {
         $result['errcode'] = 1;
         $result['errmsg'] = "errmsg";
     } else {
         $result = array('errcode' => 0, 'errmsg' => 'OK', 'data' => $order->count, 'link' => '/common/orders?status=PENDING');
         $cache->save($result, $cache_key);
     }
     $this->getResponse()->setBody(Zend_Json::encode($result));
 }
开发者ID:roozbehmatloobi,项目名称:Zend-RestAPI-V1,代码行数:26,代码来源:V1Controller.php


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