本文整理汇总了PHP中CRM_Core_BAO_CustomField::buildOption方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_CustomField::buildOption方法的具体用法?PHP CRM_Core_BAO_CustomField::buildOption怎么用?PHP CRM_Core_BAO_CustomField::buildOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_CustomField
的用法示例。
在下文中一共展示了CRM_Core_BAO_CustomField::buildOption方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addColumns
function addColumns()
{
// add all the fields for chosen groups
$this->_tables = $this->_options = array();
foreach ($this->_groupTree as $groupID => $group) {
if (!CRM_Utils_Array::value($groupID, $this->_customGroupIDs)) {
continue;
}
// now handle all the fields
foreach ($group['fields'] as $fieldID => $field) {
$this->_columns[$field['label']] = "custom_{$field['id']}";
if (!array_key_exists($group['table_name'], $this->_tables)) {
$this->_tables[$group['table_name']] = array();
}
$this->_tables[$group['table_name']][$field['id']] = $field['column_name'];
// also build the option array
$this->_options[$field['id']] = array();
CRM_Core_BAO_CustomField::buildOption($field, $this->_options[$field['id']]);
}
}
}
示例2: getCustomFieldDataLabels
public static function getCustomFieldDataLabels($data)
{
if (empty($data)) {
return $data;
}
$tempArray = array();
$data = explode('<br/>', $data);
foreach ($data as $value) {
if (empty($value)) {
continue;
}
$value = explode('::::', $value);
if (CRM_Utils_Array::value(1, $value)) {
if (empty(self::$_customFieldOptions[$value[1]])) {
$result = civicrm_api3('CustomField', 'getsingle', array('sequential' => 1, 'id' => $value[1]));
$options[$value[1]] = array();
CRM_Core_BAO_CustomField::buildOption($result, $options[$value[1]]);
self::$_customFieldOptions[$value[1]] = $options;
}
$tempArray[] = CRM_Core_BAO_CustomField::getDisplayValue($value[0], $value[1], self::$_customFieldOptions[$value[1]]);
} else {
$tempArray[] = $value[0];
}
}
return implode('<br/>', $tempArray);
}