本文整理汇总了PHP中CRM_Core_Component::get方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Component::get方法的具体用法?PHP CRM_Core_Component::get怎么用?PHP CRM_Core_Component::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Component
的用法示例。
在下文中一共展示了CRM_Core_Component::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
public function install()
{
if (array_key_exists($this->ext->key, $this->customReports)) {
CRM_Core_Error::fatal('This report is already registered.');
}
if ($this->ext->typeInfo['component'] === 'Contact') {
$compId = 'null';
} else {
$comp = CRM_Core_Component::get($this->ext->typeInfo['component']);
$compId = $comp->componentID;
}
if (empty($compId)) {
CRM_Core_Error::fatal("Component for which you're trying to install the extension (" . $this->ext->typeInfo['component'] . ") is currently disabled.");
}
$weight = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue', array('option_group_id' => $this->groupId));
$ids = array();
$params = array('label' => $this->ext->label . ' (' . $this->ext->key . ')', 'value' => $this->ext->typeInfo['reportUrl'], 'name' => $this->ext->key, 'weight' => $weight, 'description' => $this->ext->label . ' (' . $this->ext->key . ')', 'component_id' => $compId, 'option_group_id' => $this->groupId, 'is_active' => 1);
$optionValue = CRM_Core_BAO_OptionValue::add($params, $ids);
}