本文整理汇总了PHP中CRM_Core_SelectValues::county方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_SelectValues::county方法的具体用法?PHP CRM_Core_SelectValues::county怎么用?PHP CRM_Core_SelectValues::county使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_SelectValues
的用法示例。
在下文中一共展示了CRM_Core_SelectValues::county方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolveDefaults
/**
*
* Get the values for pseudoconstants for name->value and reverse.
*
* @param array $defaults (reference) the default values, some of which need to be resolved.
* @param boolean $reverse true if we want to resolve the values in the reverse direction (value -> name)
*
* @return none
* @access public
* @static
*/
function resolveDefaults(&$defaults, $reverse = false)
{
// hack for birth_date
if (CRM_Utils_Array::value('birth_date', $defaults)) {
if (is_array($defaults['birth_date'])) {
$defaults['birth_date'] = CRM_Utils_Date::format($defaults['birth_date'], '-');
}
}
if (CRM_Utils_Array::value('prefix', $defaults)) {
CRM_Contact_BAO_Contact::lookupValue($defaults, 'prefix', CRM_Core_PseudoConstant::individualPrefix(), $reverse);
}
if (CRM_Utils_Array::value('suffix', $defaults)) {
CRM_Contact_BAO_Contact::lookupValue($defaults, 'suffix', CRM_Core_PseudoConstant::individualSuffix(), $reverse);
}
if (CRM_Utils_Array::value('gender', $defaults)) {
CRM_Contact_BAO_Contact::lookupValue($defaults, 'gender', CRM_Core_PseudoConstant::gender(), $reverse);
}
if (array_key_exists('location', $defaults)) {
$locations =& $defaults['location'];
foreach ($locations as $index => $location) {
$location =& $locations[$index];
CRM_Contact_BAO_Contact::lookupValue($location, 'location_type', CRM_Core_PseudoConstant::locationType(), $reverse);
// FIXME: lookupValue doesn't work for vcard_name
$vcardNames =& CRM_Core_PseudoConstant::locationVcardName();
$location['vcard_name'] = $vcardNames[$location['location_type_id']];
if (array_key_exists('address', $location)) {
if (!CRM_Contact_BAO_Contact::lookupValue($location['address'], 'state_province', CRM_Core_PseudoConstant::stateProvince(), $reverse) && $reverse) {
CRM_Contact_BAO_Contact::lookupValue($location['address'], 'state_province', CRM_Core_PseudoConstant::stateProvinceAbbreviation(), $reverse);
}
if (!CRM_Contact_BAO_Contact::lookupValue($location['address'], 'country', CRM_Core_PseudoConstant::country(), $reverse) && $reverse) {
CRM_Contact_BAO_Contact::lookupValue($location['address'], 'country', CRM_Core_PseudoConstant::countryIsoCode(), $reverse);
}
CRM_Contact_BAO_Contact::lookupValue($location['address'], 'county', CRM_Core_SelectValues::county(), $reverse);
}
if (array_key_exists('im', $location)) {
$ims =& $location['im'];
foreach ($ims as $innerIndex => $im) {
$im =& $ims[$innerIndex];
CRM_Contact_BAO_Contact::lookupValue($im, 'provider', CRM_Core_PseudoConstant::IMProvider(), $reverse);
unset($im);
}
}
unset($location);
}
}
}