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


PHP CRM_Contribute_DAO_Product::orderBy方法代碼示例

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


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

示例1: products

 /**
  * Get all premiums.
  *
  *
  * @param int $pageID
  * @return array
  *   array of all Premiums if any
  */
 public static function products($pageID = NULL)
 {
     $products = array();
     $dao = new CRM_Contribute_DAO_Product();
     $dao->is_active = 1;
     $dao->orderBy('id');
     $dao->find();
     while ($dao->fetch()) {
         $products[$dao->id] = $dao->name;
     }
     if ($pageID) {
         $dao = new CRM_Contribute_DAO_Premium();
         $dao->entity_table = 'civicrm_contribution_page';
         $dao->entity_id = $pageID;
         $dao->find(TRUE);
         $premiumID = $dao->id;
         $productID = array();
         $dao = new CRM_Contribute_DAO_PremiumsProduct();
         $dao->premiums_id = $premiumID;
         $dao->find();
         while ($dao->fetch()) {
             $productID[$dao->product_id] = $dao->product_id;
         }
         $tempProduct = array();
         foreach ($products as $key => $value) {
             if (!array_key_exists($key, $productID)) {
                 $tempProduct[$key] = $value;
             }
         }
         return $tempProduct;
     }
     return $products;
 }
開發者ID:hyebahi,項目名稱:civicrm-core,代碼行數:41,代碼來源:PseudoConstant.php

示例2: browse

 /**
  * Browse all custom data groups.
  *
  *
  * @return void
  */
 public function browse()
 {
     // get all custom groups sorted by weight
     $premiums = array();
     $dao = new CRM_Contribute_DAO_Product();
     $dao->orderBy('name');
     $dao->find();
     while ($dao->fetch()) {
         $premiums[$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $premiums[$dao->id]);
         // form all action links
         $action = array_sum(array_keys($this->links()));
         if ($dao->is_active) {
             $action -= CRM_Core_Action::ENABLE;
         } else {
             $action -= CRM_Core_Action::DISABLE;
         }
         $premiums[$dao->id]['action'] = CRM_Core_Action::formLink(self::links(), $action, array('id' => $dao->id), ts('more'), FALSE, 'premium.manage.row', 'Premium', $dao->id);
         //Financial Type
         if (!empty($dao->financial_type_id)) {
             require_once 'CRM/Core/DAO.php';
             $premiums[$dao->id]['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $dao->financial_type_id, 'name');
         }
     }
     $this->assign('rows', $premiums);
 }
開發者ID:BorislavZlatanov,項目名稱:civicrm-core,代碼行數:32,代碼來源:ManagePremiums.php

示例3: browse

 /**
  * Browse all custom data groups.
  *
  *
  * @return void
  * @access public
  * @static
  */
 function browse()
 {
     // get all custom groups sorted by weight
     $premiums = array();
     $dao = new CRM_Contribute_DAO_Product();
     $dao->orderBy('name');
     $dao->find();
     while ($dao->fetch()) {
         $premiums[$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $premiums[$dao->id]);
         // form all action links
         $action = array_sum(array_keys($this->links()));
         if ($dao->is_active) {
             $action -= CRM_Core_Action::ENABLE;
         } else {
             $action -= CRM_Core_Action::DISABLE;
         }
         $premiums[$dao->id]['action'] = CRM_Core_Action::formLink(self::links(), $action, array('id' => $dao->id));
     }
     $this->assign('rows', $premiums);
 }
開發者ID:peteainsworth,項目名稱:civicrm-4.2.9-drupal,代碼行數:29,代碼來源:ManagePremiums.php


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