本文整理匯總了PHP中CRM_Contact_BAO_SavedSearch::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Contact_BAO_SavedSearch::create方法的具體用法?PHP CRM_Contact_BAO_SavedSearch::create怎麽用?PHP CRM_Contact_BAO_SavedSearch::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Contact_BAO_SavedSearch
的用法示例。
在下文中一共展示了CRM_Contact_BAO_SavedSearch::create方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: createSmartGroup
/**
* Defines a new smart group.
*
* @param array $params
* Associative array of parameters.
*
* @return CRM_Contact_BAO_Group|NULL
* The new group BAO (if created)
*/
public static function createSmartGroup(&$params)
{
if (!empty($params['formValues'])) {
$ssParams = $params;
unset($ssParams['id']);
if (isset($ssParams['saved_search_id'])) {
$ssParams['id'] = $ssParams['saved_search_id'];
}
$savedSearch = CRM_Contact_BAO_SavedSearch::create($params);
$params['saved_search_id'] = $savedSearch->id;
} else {
return NULL;
}
return self::create($params);
}
示例2: smartGroupCreate
/**
* Create a smart group.
*
* By default it will be a group of households.
*
* @param array $smartGroupParams
* @param array $groupParams
* @return int
*/
public function smartGroupCreate($smartGroupParams = array(), $groupParams = array())
{
$smartGroupParams = array_merge(array('formValues' => array('contact_type' => array('IN' => array('Household')))), $smartGroupParams);
$savedSearch = CRM_Contact_BAO_SavedSearch::create($smartGroupParams);
$groupParams['saved_search_id'] = $savedSearch->id;
return $this->groupCreate($groupParams);
}