本文整理汇总了PHP中CRM_Price_BAO_Set::getSetId方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Price_BAO_Set::getSetId方法的具体用法?PHP CRM_Price_BAO_Set::getSetId怎么用?PHP CRM_Price_BAO_Set::getSetId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Price_BAO_Set
的用法示例。
在下文中一共展示了CRM_Price_BAO_Set::getSetId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* edit custom Option.
*
* editing would involved modifying existing fields + adding data to new fields.
*
* @param string $action the action to be invoked
*
* @return void
* @access public
*/
function edit($action)
{
$oid = CRM_Utils_Request::retrieve('oid', 'Positive', $this, FALSE, 0);
$params = array();
if ($oid) {
$params['oid'] = $oid;
$sid = CRM_Price_BAO_Set::getSetId($params);
$usedBy = CRM_Price_BAO_Set::getUsedBy($sid);
}
// set the userContext stack
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field/option', "reset=1&action=browse&fid={$this->_fid}&sid={$this->_sid}"));
$controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Option', ts('Price Field Option'), $action);
$controller->set('fid', $this->_fid);
$controller->setEmbedded(TRUE);
$controller->process();
$controller->run();
$this->browse();
if ($action & CRM_Core_Action::DELETE) {
// add breadcrumb
$url = CRM_Utils_System::url('civicrm/admin/price/field/option', 'reset=1');
CRM_Utils_System::appendBreadCrumb(ts('Price Option'), $url);
$this->assign('usedPriceSetTitle', CRM_Price_BAO_FieldValue::getOptionLabel($oid));
$this->assign('usedBy', $usedBy);
$comps = array("Event" => "civicrm_event", "Contribution" => "civicrm_contribution_page");
$priceSetContexts = array();
foreach ($comps as $name => $table) {
if (array_key_exists($table, $usedBy)) {
$priceSetContexts[] = $name;
}
}
$this->assign('contexts', $priceSetContexts);
}
}
示例2: edit
/**
* edit custom Option.
*
* editing would involved modifying existing fields + adding data to new fields.
*
* @param string $action the action to be invoked
*
* @return void
* @access public
*/
function edit($action)
{
$oid = CRM_Utils_Request::retrieve('oid', 'Positive', $this, false, 0);
$params = array();
if ($oid) {
$params['oid'] = $oid;
require_once 'CRM/Price/BAO/Set.php';
$sid = CRM_Price_BAO_Set::getSetId($params);
require_once 'CRM/Price/BAO/Set.php';
$usedBy =& CRM_Price_BAO_Set::getUsedBy($sid);
}
// set the userContext stack
$session =& CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field/option', "reset=1&action=browse&fid={$this->_fid}&sid={$this->_sid}"));
$controller =& new CRM_Core_Controller_Simple('CRM_Price_Form_Option', ts('Price Field Option'), $action);
$controller->set('fid', $this->_fid);
$controller->setEmbedded(true);
$controller->process();
$controller->run();
$this->browse();
if ($action & CRM_Core_Action::DELETE) {
// add breadcrumb
require_once 'CRM/Core/BAO/OptionValue.php';
$url = CRM_Utils_System::url('civicrm/admin/price/field/option', 'reset=1');
CRM_Utils_System::appendBreadCrumb(ts('Price Option'), $url);
$this->assign('usedPriceSetTitle', CRM_Core_BAO_OptionValue::getTitle($oid));
$this->assign('usedBy', $usedBy);
}
}