+ /**
+ * @param array $field
+ * @param string|null $optionGroupName
+ */
+ private static function getOptionsForField(&$field, $optionGroupName) {
+ if ($optionGroupName) {
+ $field['pseudoconstant'] = array(
+ 'optionGroupName' => $optionGroupName,
+ 'optionEditPath' => 'civicrm/admin/options/' . $optionGroupName,
+ );
+ }
+ elseif ($field['data_type'] == 'Boolean') {
+ $field['pseudoconstant'] = array(
+ 'callback' => 'CRM_Core_SelectValues::boolean',
+ );
+ }
+ elseif ($field['data_type'] == 'Country') {
+ $field['pseudoconstant'] = array(
+ 'table' => 'civicrm_country',
+ 'keyColumn' => 'id',
+ 'labelColumn' => 'name',
+ 'nameColumn' => 'iso_code',
+ );
+ }
+ elseif ($field['data_type'] == 'StateProvince') {
+ $field['pseudoconstant'] = array(
+ 'table' => 'civicrm_state_province',
+ 'keyColumn' => 'id',
+ 'labelColumn' => 'name',
+ );
+ }
+ }
+
+}