本文整理匯總了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);
}
}
}