本文整理汇总了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);
}
}
}