本文整理匯總了PHP中CRM_Core_BAO_CustomGroup::_addWhereAdd方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_BAO_CustomGroup::_addWhereAdd方法的具體用法?PHP CRM_Core_BAO_CustomGroup::_addWhereAdd怎麽用?PHP CRM_Core_BAO_CustomGroup::_addWhereAdd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Core_BAO_CustomGroup
的用法示例。
在下文中一共展示了CRM_Core_BAO_CustomGroup::_addWhereAdd方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addMenuTabs
/**
*
* This function does 2 things -
* 1 - Create menu tabs for all custom groups with style 'Tab'
* 2 - Updates tab for custom groups with style 'Inline'. If there
* are no inline groups it removes the 'Custom Data' tab
*
*
* @param string $entityType - what entity are we extending here ?
* @param string $path - what should be the starting path for the new menus ?
* @param int $startWeight - weight to start the local menu tabs
*
* @return void
*
* @access public
* @static
*
*/
function addMenuTabs($entityType, $path, $startWeight)
{
// for Tab's
$customGroupDAO =& new CRM_Core_DAO_CustomGroup();
// get only 'Tab' groups
$customGroupDAO->whereAdd("style = 'Tab'");
$customGroupDAO->whereAdd("is_active = 1");
$customGroupDAO->whereAdd("domain_id =" . CRM_Core_Config::domainID());
// add whereAdd for entity type
CRM_Core_BAO_CustomGroup::_addWhereAdd($customGroupDAO, $entityType);
// order by weight
$customGroupDAO->orderBy('weight');
$customGroupDAO->find();
// process each group with menu tab
while ($customGroupDAO->fetch()) {
$menu = array();
$menu['path'] = $path;
$menu['title'] = "{$customGroupDAO->title}";
$menu['qs'] = 'reset=1&gid=' . $customGroupDAO->id . '&cid=%%cid%%';
$menu['type'] = CRM_UTILS_MENU_CALLBACK;
$menu['crmType'] = CRM_UTILS_MENU_LOCAL_TASK;
$menu['weight'] = $startWeight++;
$menu['extra'] = array('gid' => $customGroupDAO->id);
$menus[] = $menu;
}
if (is_array($menus)) {
foreach ($menus as $menu) {
CRM_Utils_Menu::add($menu);
}
}
}