本文整理匯總了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;
}
示例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);
}
示例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);
}