* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'deny' => 'deny',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'operation' => 'operation',
- 'object_table' => 'object_table',
- 'object_id' => 'object_id',
- 'acl_table' => 'acl_table',
- 'acl_id' => 'acl_id',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'acl_id' => 'acl_id',
- 'modified_date' => 'modified_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'acl_role_id' => 'acl_role_id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'activity_id',
- 'source_record_id' => 'source_record_id',
- 'activity_type_id' => 'activity_type_id',
- 'subject' => 'activity_subject',
- 'activity_date_time' => 'activity_date_time',
- 'duration' => 'activity_duration',
- 'location' => 'activity_location',
- 'phone_id' => 'phone_id',
- 'phone_number' => 'phone_number',
- 'details' => 'activity_details',
- 'status_id' => 'activity_status_id',
- 'priority_id' => 'priority_id',
- 'parent_id' => 'parent_id',
- 'is_test' => 'activity_is_test',
- 'medium_id' => 'activity_medium_id',
- 'is_auto' => 'is_auto',
- 'relationship_id' => 'relationship_id',
- 'is_current_revision' => 'is_current_revision',
- 'original_id' => 'original_id',
- 'result' => 'activity_result',
- 'is_deleted' => 'activity_is_deleted',
- 'campaign_id' => 'activity_campaign_id',
- 'engagement_level' => 'activity_engagement_level',
- 'weight' => 'weight',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'activity_id' => 'activity_id',
- 'contact_id' => 'contact_id',
- 'record_type_id' => 'record_type_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'description' => 'description',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'modified_id' => 'modified_id',
- 'modified_date' => 'modified_date',
- 'saved_search_id' => 'saved_search_id',
- 'status_id' => 'status_id',
- 'type_id' => 'type_id',
- 'mode_id' => 'mode_id',
- 'total' => 'total',
- 'item_count' => 'item_count',
- 'payment_instrument_id' => 'payment_instrument_id',
- 'exported_date' => 'exported_date',
- 'data' => 'data',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'batch_id' => 'batch_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'description' => 'description',
- 'start_date' => 'start_date',
- 'end_date' => 'end_date',
- 'campaign_type_id' => 'campaign_type_id',
- 'status_id' => 'status_id',
- 'external_identifier' => 'external_identifier',
- 'parent_id' => 'parent_id',
- 'is_active' => 'is_active',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'last_modified_id' => 'last_modified_id',
- 'last_modified_date' => 'last_modified_date',
- 'goal_general' => 'goal_general',
- 'goal_revenue' => 'goal_revenue',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'campaign_id' => 'campaign_id',
- 'group_type' => 'group_type',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'title' => 'title',
- 'campaign_id' => 'campaign_id',
- 'activity_type_id' => 'activity_type_id',
- 'recontact_interval' => 'recontact_interval',
- 'instructions' => 'instructions',
- 'release_frequency' => 'release_frequency',
- 'max_number_of_contacts' => 'max_number_of_contacts',
- 'default_number_of_contacts' => 'default_number_of_contacts',
- 'is_active' => 'is_active',
- 'is_default' => 'is_default',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'last_modified_id' => 'last_modified_id',
- 'last_modified_date' => 'last_modified_date',
- 'result_id' => 'result_id',
- 'bypass_confirm' => 'bypass_confirm',
- 'thankyou_title' => 'thankyou_title',
- 'thankyou_text' => 'thankyou_text',
- 'is_share' => 'is_share',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'case_id',
- 'case_type_id' => 'case_type_id',
- 'subject' => 'case_subject',
- 'start_date' => 'case_start_date',
- 'end_date' => 'case_end_date',
- 'details' => 'details',
- 'status_id' => 'case_status_id',
- 'is_deleted' => 'case_deleted',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'case_id' => 'case_id',
- 'activity_id' => 'activity_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'case_id' => 'case_id',
- 'contact_id' => 'case_contact_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'description' => 'description',
- 'is_active' => 'is_active',
- 'is_reserved' => 'is_reserved',
- 'weight' => 'weight',
- 'definition' => 'definition',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'user_id' => 'user_id',
- 'contact_id' => 'contact_id',
- 'operation' => 'operation',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_type' => 'contact_type',
- 'contact_sub_type' => 'contact_sub_type',
- 'do_not_email' => 'do_not_email',
- 'do_not_phone' => 'do_not_phone',
- 'do_not_mail' => 'do_not_mail',
- 'do_not_sms' => 'do_not_sms',
- 'do_not_trade' => 'do_not_trade',
- 'is_opt_out' => 'is_opt_out',
- 'legal_identifier' => 'legal_identifier',
- 'external_identifier' => 'external_identifier',
- 'sort_name' => 'sort_name',
- 'display_name' => 'display_name',
- 'nick_name' => 'nick_name',
- 'legal_name' => 'legal_name',
- 'image_URL' => 'image_URL',
- 'preferred_communication_method' => 'preferred_communication_method',
- 'preferred_language' => 'preferred_language',
- 'preferred_mail_format' => 'preferred_mail_format',
- 'hash' => 'hash',
- 'api_key' => 'api_key',
- 'source' => 'contact_source',
- 'first_name' => 'first_name',
- 'middle_name' => 'middle_name',
- 'last_name' => 'last_name',
- 'prefix_id' => 'prefix_id',
- 'suffix_id' => 'suffix_id',
- 'formal_title' => 'formal_title',
- 'communication_style_id' => 'communication_style_id',
- 'email_greeting_id' => 'email_greeting_id',
- 'email_greeting_custom' => 'email_greeting_custom',
- 'email_greeting_display' => 'email_greeting_display',
- 'postal_greeting_id' => 'postal_greeting_id',
- 'postal_greeting_custom' => 'postal_greeting_custom',
- 'postal_greeting_display' => 'postal_greeting_display',
- 'addressee_id' => 'addressee_id',
- 'addressee_custom' => 'addressee_custom',
- 'addressee_display' => 'addressee_display',
- 'job_title' => 'job_title',
- 'gender_id' => 'gender_id',
- 'birth_date' => 'birth_date',
- 'is_deceased' => 'is_deceased',
- 'deceased_date' => 'deceased_date',
- 'household_name' => 'household_name',
- 'primary_contact_id' => 'primary_contact_id',
- 'organization_name' => 'organization_name',
- 'sic_code' => 'sic_code',
- 'user_unique_id' => 'user_unique_id',
- 'employer_id' => 'current_employer_id',
- 'is_deleted' => 'contact_is_deleted',
- 'created_date' => 'created_date',
- 'modified_date' => 'modified_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'label' => 'label',
- 'description' => 'description',
- 'image_URL' => 'image_URL',
- 'parent_id' => 'parent_id',
- 'is_active' => 'is_active',
- 'is_reserved' => 'is_reserved',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'dashboard_id' => 'dashboard_id',
- 'contact_id' => 'contact_id',
- 'column_no' => 'column_no',
- 'is_minimized' => 'is_minimized',
- 'is_fullscreen' => 'is_fullscreen',
- 'is_active' => 'is_active',
- 'weight' => 'weight',
- 'content' => 'content',
- 'created_date' => 'created_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'description' => 'description',
- 'source' => 'source',
- 'saved_search_id' => 'saved_search_id',
- 'is_active' => 'is_active',
- 'visibility' => 'visibility',
- 'where_clause' => 'where_clause',
- 'select_tables' => 'select_tables',
- 'where_tables' => 'where_tables',
- 'group_type' => 'group_type',
- 'cache_date' => 'cache_date',
- 'refresh_date' => 'refresh_date',
- 'parents' => 'parents',
- 'children' => 'children',
- 'is_hidden' => 'is_hidden',
- 'is_reserved' => 'is_reserved',
- 'created_id' => 'created_id',
- 'modified_id' => 'modified_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'group_id' => 'group_id',
- 'contact_id' => 'contact_id',
- 'status' => 'status',
- 'location_id' => 'location_id',
- 'email_id' => 'email_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'group_id' => 'group_id',
- 'contact_id' => 'contact_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'child_group_id' => 'child_group_id',
- 'parent_group_id' => 'parent_group_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'group_id' => 'group_id',
- 'organization_id' => 'organization_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id_a' => 'contact_id_a',
- 'contact_id_b' => 'contact_id_b',
- 'relationship_type_id' => 'relationship_type_id',
- 'start_date' => 'start_date',
- 'end_date' => 'end_date',
- 'is_active' => 'is_active',
- 'description' => 'description',
- 'is_permission_a_b' => 'is_permission_a_b',
- 'is_permission_b_a' => 'is_permission_b_a',
- 'case_id' => 'case_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name_a_b' => 'name_a_b',
- 'label_a_b' => 'label_a_b',
- 'name_b_a' => 'name_b_a',
- 'label_b_a' => 'label_b_a',
- 'description' => 'description',
- 'contact_type_a' => 'contact_type_a',
- 'contact_type_b' => 'contact_type_b',
- 'contact_sub_type_a' => 'contact_sub_type_a',
- 'contact_sub_type_b' => 'contact_sub_type_b',
- 'is_reserved' => 'is_reserved',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'form_values' => 'form_values',
- 'mapping_id' => 'mapping_id',
- 'search_custom_id' => 'search_custom_id',
- 'where_clause' => 'where_clause',
- 'select_tables' => 'select_tables',
- 'where_tables' => 'where_tables',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'group_id' => 'group_id',
- 'date' => 'date',
- 'method' => 'method',
- 'status' => 'status',
- 'tracking' => 'tracking',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'contribution_id',
- 'contact_id' => 'contribution_contact_id',
- 'financial_type_id' => 'financial_type_id',
- 'contribution_page_id' => 'contribution_page_id',
- 'payment_instrument_id' => 'payment_instrument_id',
- 'receive_date' => 'receive_date',
- 'non_deductible_amount' => 'non_deductible_amount',
- 'total_amount' => 'total_amount',
- 'fee_amount' => 'fee_amount',
- 'net_amount' => 'net_amount',
- 'trxn_id' => 'trxn_id',
- 'invoice_id' => 'invoice_id',
- 'currency' => 'currency',
- 'cancel_date' => 'cancel_date',
- 'cancel_reason' => 'cancel_reason',
- 'receipt_date' => 'receipt_date',
- 'thankyou_date' => 'thankyou_date',
- 'source' => 'contribution_source',
- 'amount_level' => 'amount_level',
- 'contribution_recur_id' => 'contribution_recur_id',
- 'is_test' => 'is_test',
- 'is_pay_later' => 'is_pay_later',
- 'contribution_status_id' => 'contribution_status_id',
- 'address_id' => 'address_id',
- 'check_number' => 'check_number',
- 'campaign_id' => 'contribution_campaign_id',
- 'creditnote_id' => 'creditnote_id',
- 'tax_amount' => 'tax_amount',
- 'revenue_recognition_date' => 'revenue_recognition_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'title' => 'title',
- 'intro_text' => 'intro_text',
- 'financial_type_id' => 'financial_type_id',
- 'payment_processor' => 'payment_processor',
- 'is_credit_card_only' => 'is_credit_card_only',
- 'is_monetary' => 'is_monetary',
- 'is_recur' => 'is_recur',
- 'is_confirm_enabled' => 'is_confirm_enabled',
- 'recur_frequency_unit' => 'recur_frequency_unit',
- 'is_recur_interval' => 'is_recur_interval',
- 'is_recur_installments' => 'is_recur_installments',
- 'adjust_recur_start_date' => 'adjust_recur_start_date',
- 'is_pay_later' => 'is_pay_later',
- 'pay_later_text' => 'pay_later_text',
- 'pay_later_receipt' => 'pay_later_receipt',
- 'is_partial_payment' => 'is_partial_payment',
- 'initial_amount_label' => 'initial_amount_label',
- 'initial_amount_help_text' => 'initial_amount_help_text',
- 'min_initial_amount' => 'min_initial_amount',
- 'is_allow_other_amount' => 'is_allow_other_amount',
- 'default_amount_id' => 'default_amount_id',
- 'min_amount' => 'min_amount',
- 'max_amount' => 'max_amount',
- 'goal_amount' => 'goal_amount',
- 'thankyou_title' => 'thankyou_title',
- 'thankyou_text' => 'thankyou_text',
- 'thankyou_footer' => 'thankyou_footer',
- 'is_email_receipt' => 'is_email_receipt',
- 'receipt_from_name' => 'receipt_from_name',
- 'receipt_from_email' => 'receipt_from_email',
- 'cc_receipt' => 'cc_receipt',
- 'bcc_receipt' => 'bcc_receipt',
- 'receipt_text' => 'receipt_text',
- 'is_active' => 'is_active',
- 'footer_text' => 'footer_text',
- 'amount_block_is_active' => 'amount_block_is_active',
- 'start_date' => 'start_date',
- 'end_date' => 'end_date',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'currency' => 'currency',
- 'campaign_id' => 'campaign_id',
- 'is_share' => 'is_share',
- 'is_billing_required' => 'is_billing_required',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'product_id' => 'product_id',
- 'contribution_id' => 'contribution_id',
- 'product_option' => 'product_option',
- 'quantity' => 'quantity',
- 'fulfilled_date' => 'fulfilled_date',
- 'start_date' => 'contribution_start_date',
- 'end_date' => 'contribution_end_date',
- 'comment' => 'comment',
- 'financial_type_id' => 'financial_type_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'amount' => 'amount',
- 'currency' => 'currency',
- 'frequency_unit' => 'frequency_unit',
- 'frequency_interval' => 'frequency_interval',
- 'installments' => 'installments',
- 'start_date' => 'start_date',
- 'create_date' => 'create_date',
- 'modified_date' => 'modified_date',
- 'cancel_date' => 'cancel_date',
- 'end_date' => 'end_date',
- 'processor_id' => 'processor_id',
- 'payment_token_id' => 'payment_token_id',
- 'trxn_id' => 'trxn_id',
- 'invoice_id' => 'invoice_id',
- 'contribution_status_id' => 'contribution_status_id',
- 'is_test' => 'is_test',
- 'cycle_day' => 'cycle_day',
- 'next_sched_contribution_date' => 'next_sched_contribution_date',
- 'failure_count' => 'failure_count',
- 'failure_retry_date' => 'failure_retry_date',
- 'auto_renew' => 'auto_renew',
- 'payment_processor_id' => 'payment_processor_id',
- 'financial_type_id' => 'financial_type_id',
- 'payment_instrument_id' => 'payment_instrument_id',
- 'campaign_id' => 'contribution_campaign_id',
- 'is_email_receipt' => 'is_email_receipt',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'contribution_soft_id',
- 'contribution_id' => 'contribution_id',
- 'contact_id' => 'contribution_soft_contact_id',
- 'amount' => 'amount',
- 'currency' => 'currency',
- 'pcp_id' => 'pcp_id',
- 'pcp_display_in_roll' => 'pcp_display_in_roll',
- 'pcp_roll_nickname' => 'pcp_roll_nickname',
- 'pcp_personal_note' => 'pcp_personal_note',
- 'soft_credit_type_id' => 'soft_credit_type_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'premiums_active' => 'premiums_active',
- 'premiums_intro_title' => 'premiums_intro_title',
- 'premiums_intro_text' => 'premiums_intro_text',
- 'premiums_contact_email' => 'premiums_contact_email',
- 'premiums_contact_phone' => 'premiums_contact_phone',
- 'premiums_display_min_contribution' => 'premiums_display_min_contribution',
- 'premiums_nothankyou_label' => 'premiums_nothankyou_label',
- 'premiums_nothankyou_position' => 'premiums_nothankyou_position',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'premiums_id' => 'premiums_id',
- 'product_id' => 'product_id',
- 'weight' => 'weight',
- 'financial_type_id' => 'financial_type_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'product_name',
- 'description' => 'description',
- 'sku' => 'sku',
- 'options' => 'options',
- 'image' => 'image',
- 'thumbnail' => 'thumbnail',
- 'price' => 'price',
- 'currency' => 'currency',
- 'financial_type_id' => 'financial_type_id',
- 'min_contribution' => 'min_contribution',
- 'cost' => 'cost',
- 'is_active' => 'is_active',
- 'period_type' => 'period_type',
- 'fixed_period_start_day' => 'fixed_period_start_day',
- 'duration_unit' => 'duration_unit',
- 'duration_interval' => 'duration_interval',
- 'frequency_unit' => 'frequency_unit',
- 'frequency_interval' => 'frequency_interval',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contribution_page_id' => 'contribution_page_id',
- 'is_active' => 'is_active',
- 'title' => 'title',
- 'url_logo' => 'url_logo',
- 'button_title' => 'button_title',
- 'about' => 'about',
- 'url_homepage' => 'url_homepage',
- 'color_title' => 'color_title',
- 'color_button' => 'color_button',
- 'color_bar' => 'color_bar',
- 'color_main_text' => 'color_main_text',
- 'color_main' => 'color_main',
- 'color_main_bg' => 'color_main_bg',
- 'color_bg' => 'color_bg',
- 'color_about_link' => 'color_about_link',
- 'color_homepage_link' => 'color_homepage_link',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'entity_id' => 'entity_id',
- 'entity_table' => 'entity_table',
- 'action_schedule_id' => 'action_schedule_id',
- 'action_date_time' => 'action_date_time',
- 'is_error' => 'is_error',
- 'message' => 'message',
- 'repetition_number' => 'repetition_number',
- 'reference_date' => 'reference_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity' => 'entity',
- 'entity_value' => 'entity_value',
- 'entity_value_label' => 'entity_value_label',
- 'entity_status' => 'entity_status',
- 'entity_status_label' => 'entity_status_label',
- 'entity_date_start' => 'entity_date_start',
- 'entity_date_end' => 'entity_date_end',
- 'entity_recipient' => 'entity_recipient',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'recipient' => 'recipient',
- 'limit_to' => 'limit_to',
- 'entity_value' => 'entity_value',
- 'entity_status' => 'entity_status',
- 'start_action_offset' => 'start_action_offset',
- 'start_action_unit' => 'start_action_unit',
- 'start_action_condition' => 'start_action_condition',
- 'start_action_date' => 'start_action_date',
- 'is_repeat' => 'is_repeat',
- 'repetition_frequency_unit' => 'repetition_frequency_unit',
- 'repetition_frequency_interval' => 'repetition_frequency_interval',
- 'end_frequency_unit' => 'end_frequency_unit',
- 'end_frequency_interval' => 'end_frequency_interval',
- 'end_action' => 'end_action',
- 'end_date' => 'end_date',
- 'is_active' => 'is_active',
- 'recipient_manual' => 'recipient_manual',
- 'recipient_listing' => 'recipient_listing',
- 'body_text' => 'body_text',
- 'body_html' => 'body_html',
- 'sms_body_text' => 'sms_body_text',
- 'subject' => 'subject',
- 'record_activity' => 'record_activity',
- 'mapping_id' => 'mapping_id',
- 'group_id' => 'group_id',
- 'msg_template_id' => 'msg_template_id',
- 'sms_template_id' => 'sms_template_id',
- 'absolute_date' => 'absolute_date',
- 'from_name' => 'from_name',
- 'from_email' => 'from_email',
- 'mode' => 'mode',
- 'sms_provider_id' => 'sms_provider_id',
- 'used_for' => 'used_for',
- 'filter_contact_language' => 'filter_contact_language',
- 'communication_language' => 'communication_language',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'location_type_id' => 'location_type_id',
- 'is_primary' => 'is_primary',
- 'is_billing' => 'is_billing',
- 'street_address' => 'street_address',
- 'street_number' => 'street_number',
- 'street_number_suffix' => 'street_number_suffix',
- 'street_number_predirectional' => 'street_number_predirectional',
- 'street_name' => 'street_name',
- 'street_type' => 'street_type',
- 'street_number_postdirectional' => 'street_number_postdirectional',
- 'street_unit' => 'street_unit',
- 'supplemental_address_1' => 'supplemental_address_1',
- 'supplemental_address_2' => 'supplemental_address_2',
- 'supplemental_address_3' => 'supplemental_address_3',
- 'city' => 'city',
- 'county_id' => 'county_id',
- 'state_province_id' => 'state_province_id',
- 'postal_code_suffix' => 'postal_code_suffix',
- 'postal_code' => 'postal_code',
- 'usps_adc' => 'usps_adc',
- 'country_id' => 'country_id',
- 'geo_code_1' => 'geo_code_1',
- 'geo_code_2' => 'geo_code_2',
- 'manual_geo_code' => 'manual_geo_code',
- 'timezone' => 'timezone',
- 'name' => 'address_name',
- 'master_id' => 'master_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'format' => 'format',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
-// (GenCodeChecksum:14fe20bf74c92c5422f20d8b99684a5b)
+// (GenCodeChecksum:b13780d76d6f597c98c782343c2e5876)
return array(
'CRM_Core_DAO_AddressFormat' => array(
'name' => 'AddressFormat',
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'group_name' => 'group_name',
- 'path' => 'path',
- 'data' => 'data',
- 'component_id' => 'component_id',
- 'created_date' => 'created_date',
- 'expired_date' => 'expired_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'namespace' => 'namespace',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'iso_code' => 'iso_code',
- 'country_code' => 'country_code',
- 'address_format_id' => 'address_format_id',
- 'idd_prefix' => 'idd_prefix',
- 'ndd_prefix' => 'ndd_prefix',
- 'region_id' => 'region_id',
- 'is_province_abbreviated' => 'is_province_abbreviated',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'abbreviation' => 'abbreviation',
- 'state_province_id' => 'state_province_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'custom_group_id' => 'custom_group_id',
- 'name' => 'name',
- 'label' => 'label',
- 'data_type' => 'data_type',
- 'html_type' => 'html_type',
- 'default_value' => 'default_value',
- 'is_required' => 'is_required',
- 'is_searchable' => 'is_searchable',
- 'is_search_range' => 'is_search_range',
- 'weight' => 'weight',
- 'help_pre' => 'help_pre',
- 'help_post' => 'help_post',
- 'mask' => 'mask',
- 'attributes' => 'attributes',
- 'javascript' => 'javascript',
- 'is_active' => 'is_active',
- 'is_view' => 'is_view',
- 'options_per_line' => 'options_per_line',
- 'text_length' => 'text_length',
- 'start_date_years' => 'start_date_years',
- 'end_date_years' => 'end_date_years',
- 'date_format' => 'date_format',
- 'time_format' => 'time_format',
- 'note_columns' => 'note_columns',
- 'note_rows' => 'note_rows',
- 'column_name' => 'column_name',
- 'option_group_id' => 'option_group_id',
- 'filter' => 'filter',
- 'in_selector' => 'in_selector',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'extends' => 'extends',
- 'extends_entity_column_id' => 'extends_entity_column_id',
- 'extends_entity_column_value' => 'extends_entity_column_value',
- 'style' => 'style',
- 'collapse_display' => 'collapse_display',
- 'help_pre' => 'help_pre',
- 'help_post' => 'help_post',
- 'weight' => 'weight',
- 'is_active' => 'is_active',
- 'table_name' => 'table_name',
- 'is_multiple' => 'is_multiple',
- 'min_multiple' => 'min_multiple',
- 'max_multiple' => 'max_multiple',
- 'collapse_adv_display' => 'collapse_adv_display',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'is_reserved' => 'is_reserved',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'name' => 'name',
- 'label' => 'label',
- 'url' => 'url',
- 'permission' => 'permission',
- 'permission_operator' => 'permission_operator',
- 'column_no' => 'column_no',
- 'is_minimized' => 'is_minimized',
- 'fullscreen_url' => 'fullscreen_url',
- 'is_fullscreen' => 'is_fullscreen',
- 'is_active' => 'is_active',
- 'is_reserved' => 'is_reserved',
- 'weight' => 'weight',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'price_set_id' => 'participant_discount_name',
- 'start_date' => 'start_date',
- 'end_date' => 'end_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'description' => 'description',
- 'config_backend' => 'config_backend',
- 'version' => 'version',
- 'contact_id' => 'contact_id',
- 'locales' => 'locales',
- 'locale_custom_strings' => 'locale_custom_strings',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'location_type_id' => 'location_type_id',
- 'email' => 'email',
- 'is_primary' => 'is_primary',
- 'is_billing' => 'is_billing',
- 'on_hold' => 'on_hold',
- 'is_bulkmail' => 'is_bulkmail',
- 'hold_date' => 'hold_date',
- 'reset_date' => 'reset_date',
- 'signature_text' => 'signature_text',
- 'signature_html' => 'signature_html',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'file_id' => 'file_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'tag_id' => 'tag_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'type' => 'type',
- 'full_name' => 'full_name',
- 'name' => 'name',
- 'label' => 'label',
- 'file' => 'file',
- 'schema_version' => 'schema_version',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'file_type_id' => 'file_type_id',
- 'mime_type' => 'mime_type',
- 'uri' => 'uri',
- 'document' => 'document',
- 'description' => 'description',
- 'upload_date' => 'upload_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'location_type_id' => 'location_type_id',
- 'name' => 'name',
- 'provider_id' => 'provider_id',
- 'is_primary' => 'is_primary',
- 'is_billing' => 'is_billing',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'run_frequency' => 'run_frequency',
- 'last_run' => 'last_run',
- 'scheduled_run_date' => 'scheduled_run_date',
- 'name' => 'name',
- 'description' => 'description',
- 'api_entity' => 'api_entity',
- 'api_action' => 'api_action',
- 'parameters' => 'parameters',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'run_time' => 'run_time',
- 'job_id' => 'job_id',
- 'name' => 'name',
- 'command' => 'command',
- 'description' => 'description',
- 'data' => 'data',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'address_id' => 'address_id',
- 'email_id' => 'email_id',
- 'phone_id' => 'phone_id',
- 'im_id' => 'im_id',
- 'address_2_id' => 'address_2_id',
- 'email_2_id' => 'email_2_id',
- 'phone_2_id' => 'phone_2_id',
- 'im_2_id' => 'im_2_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'display_name' => 'display_name',
- 'vcard_name' => 'vcard_name',
- 'description' => 'description',
- 'is_reserved' => 'is_reserved',
- 'is_active' => 'is_active',
- 'is_default' => 'is_default',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'data' => 'data',
- 'modified_id' => 'modified_id',
- 'modified_date' => 'modified_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'name' => 'name',
- 'is_default' => 'is_default',
- 'domain' => 'domain',
- 'localpart' => 'localpart',
- 'return_path' => 'return_path',
- 'protocol' => 'protocol',
- 'server' => 'server',
- 'port' => 'port',
- 'username' => 'username',
- 'password' => 'password',
- 'is_ssl' => 'is_ssl',
- 'source' => 'source',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'module' => 'module',
- 'name' => 'name',
- 'entity_type' => 'entity_type',
- 'entity_id' => 'entity_id',
- 'cleanup' => 'cleanup',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'description' => 'description',
- 'mapping_type_id' => 'mapping_type_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'mapping_id' => 'mapping_id',
- 'name' => 'name',
- 'contact_type' => 'contact_type',
- 'column_number' => 'column_number',
- 'location_type_id' => 'location_type_id',
- 'phone_type_id' => 'phone_type_id',
- 'im_provider_id' => 'im_provider_id',
- 'website_type_id' => 'website_type_id',
- 'relationship_type_id' => 'relationship_type_id',
- 'relationship_direction' => 'relationship_direction',
- 'grouping' => 'grouping',
- 'operator' => 'operator',
- 'value' => 'value',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'path' => 'path',
- 'path_arguments' => 'path_arguments',
- 'title' => 'title',
- 'access_callback' => 'access_callback',
- 'access_arguments' => 'access_arguments',
- 'page_callback' => 'page_callback',
- 'page_arguments' => 'page_arguments',
- 'breadcrumb' => 'breadcrumb',
- 'return_url' => 'return_url',
- 'return_url_args' => 'return_url_args',
- 'component_id' => 'component_id',
- 'is_active' => 'is_active',
- 'is_public' => 'is_public',
- 'is_exposed' => 'is_exposed',
- 'is_ssl' => 'is_ssl',
- 'weight' => 'weight',
- 'type' => 'type',
- 'page_type' => 'page_type',
- 'skipBreadcrumb' => 'skipBreadcrumb',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'msg_title' => 'msg_title',
- 'msg_subject' => 'msg_subject',
- 'msg_text' => 'msg_text',
- 'msg_html' => 'msg_html',
- 'is_active' => 'is_active',
- 'workflow_id' => 'workflow_id',
- 'is_default' => 'is_default',
- 'is_reserved' => 'is_reserved',
- 'is_sms' => 'is_sms',
- 'pdf_format_id' => 'pdf_format_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'label' => 'label',
- 'name' => 'name',
- 'url' => 'url',
- 'permission' => 'permission',
- 'permission_operator' => 'permission_operator',
- 'parent_id' => 'parent_id',
- 'is_active' => 'is_active',
- 'has_separator' => 'has_separator',
- 'weight' => 'weight',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'note' => 'note',
- 'contact_id' => 'contact_id',
- 'modified_date' => 'modified_date',
- 'subject' => 'subject',
- 'privacy' => 'privacy',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'location_type_id' => 'location_type_id',
- 'openid' => 'openid',
- 'allowed_to_login' => 'allowed_to_login',
- 'is_primary' => 'is_primary',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'description' => 'description',
- 'is_reserved' => 'is_reserved',
- 'is_active' => 'is_active',
- 'is_locked' => 'is_locked',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'option_group_id' => 'option_group_id',
- 'label' => 'label',
- 'value' => 'value',
- 'name' => 'name',
- 'grouping' => 'grouping',
- 'filter' => 'filter',
- 'is_default' => 'is_default',
- 'weight' => 'weight',
- 'description' => 'description',
- 'is_optgroup' => 'is_optgroup',
- 'is_reserved' => 'is_reserved',
- 'is_active' => 'is_active',
- 'component_id' => 'component_id',
- 'domain_id' => 'domain_id',
- 'visibility_id' => 'visibility_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'context' => 'context',
- 'name' => 'name',
- 'data' => 'data',
- 'is_config' => 'is_config',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'location_type_id' => 'location_type_id',
- 'is_primary' => 'is_primary',
- 'is_billing' => 'is_billing',
- 'mobile_provider_id' => 'mobile_provider_id',
- 'phone' => 'phone',
- 'phone_ext' => 'phone_ext',
- 'phone_numeric' => 'phone_numeric',
- 'phone_type_id' => 'phone_type_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'description' => 'description',
- 'start' => 'start',
- 'end' => 'end',
- 'date_format' => 'date_format',
- 'time_format' => 'time_format',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id1' => 'entity_id1',
- 'entity_id2' => 'entity_id2',
- 'cacheKey' => 'cacheKey',
- 'data' => 'data',
- 'is_selected' => 'is_selected',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'title' => 'title',
- 'name' => 'name',
- 'description' => 'description',
- 'label_format_name' => 'label_format_name',
- 'label_type_id' => 'label_type_id',
- 'data' => 'data',
- 'is_default' => 'is_default',
- 'is_active' => 'is_active',
- 'is_reserved' => 'is_reserved',
- 'created_id' => 'created_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'parent_id' => 'parent_id',
- 'entity_id' => 'entity_id',
- 'entity_table' => 'entity_table',
- 'mode' => 'mode',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'value' => 'value',
- 'domain_id' => 'domain_id',
- 'contact_id' => 'contact_id',
- 'is_domain' => 'is_domain',
- 'component_id' => 'component_id',
- 'created_date' => 'created_date',
- 'created_id' => 'created_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'abbreviation' => 'abbreviation',
- 'country_id' => 'country_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'name' => 'name',
- 'hush_until' => 'hush_until',
- 'ignore_severity' => 'ignore_severity',
- 'prefs' => 'prefs',
- 'check_info' => 'check_info',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'message' => 'message',
- 'context' => 'context',
- 'level' => 'level',
- 'timestamp' => 'timestamp',
- 'contact_id' => 'contact_id',
- 'hostname' => 'hostname',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'description' => 'description',
- 'parent_id' => 'parent_id',
- 'is_selectable' => 'is_selectable',
- 'is_reserved' => 'is_reserved',
- 'is_tagset' => 'is_tagset',
- 'used_for' => 'used_for',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'abbreviation' => 'abbreviation',
- 'gmt' => 'gmt',
- 'offset' => 'offset',
- 'country_id' => 'country_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'uf_group_id' => 'uf_group_id',
- 'field_name' => 'field_name',
- 'is_active' => 'is_active',
- 'is_view' => 'is_view',
- 'is_required' => 'is_required',
- 'weight' => 'weight',
- 'help_post' => 'help_post',
- 'help_pre' => 'help_pre',
- 'visibility' => 'visibility',
- 'in_selector' => 'in_selector',
- 'is_searchable' => 'is_searchable',
- 'location_type_id' => 'location_type_id',
- 'phone_type_id' => 'phone_type_id',
- 'website_type_id' => 'website_type_id',
- 'label' => 'label',
- 'field_type' => 'field_type',
- 'is_reserved' => 'is_reserved',
- 'is_multi_summary' => 'is_multi_summary',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'is_active' => 'is_active',
- 'group_type' => 'group_type',
- 'title' => 'title',
- 'description' => 'description',
- 'help_pre' => 'help_pre',
- 'help_post' => 'help_post',
- 'limit_listings_group_id' => 'limit_listings_group_id',
- 'post_URL' => 'post_URL',
- 'add_to_group_id' => 'add_to_group_id',
- 'add_captcha' => 'add_captcha',
- 'is_map' => 'is_map',
- 'is_edit_link' => 'is_edit_link',
- 'is_uf_link' => 'is_uf_link',
- 'is_update_dupe' => 'is_update_dupe',
- 'cancel_URL' => 'cancel_URL',
- 'is_cms_user' => 'is_cms_user',
- 'notify' => 'notify',
- 'is_reserved' => 'is_reserved',
- 'name' => 'name',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'is_proximity_search' => 'is_proximity_search',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'is_active' => 'is_active',
- 'module' => 'module',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'weight' => 'weight',
- 'uf_group_id' => 'uf_group_id',
- 'module_data' => 'module_data',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'uf_id' => 'uf_id',
- 'uf_name' => 'uf_name',
- 'contact_id' => 'contact_id',
- 'language' => 'language',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id' => 'contact_id',
- 'url' => 'url',
- 'website_type_id' => 'website_type_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'find_word' => 'find_word',
- 'replace_word' => 'replace_word',
- 'is_active' => 'is_active',
- 'match_type' => 'match_type',
- 'domain_id' => 'domain_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'world_region',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'app_guid' => 'app_guid',
- 'app_meta' => 'app_meta',
- 'cxn_guid' => 'cxn_guid',
- 'secret' => 'secret',
- 'perm' => 'perm',
- 'options' => 'options',
- 'is_active' => 'is_active',
- 'created_date' => 'created_date',
- 'modified_date' => 'modified_date',
- 'fetched_date' => 'fetched_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_id1' => 'contact_id1',
- 'contact_id2' => 'contact_id2',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'dedupe_rule_group_id' => 'dedupe_rule_group_id',
- 'rule_table' => 'rule_table',
- 'rule_field' => 'rule_field',
- 'rule_length' => 'rule_length',
- 'rule_weight' => 'rule_weight',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'contact_type' => 'contact_type',
- 'threshold' => 'threshold',
- 'used' => 'used',
- 'name' => 'name',
- 'title' => 'title',
- 'is_reserved' => 'is_reserved',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'cart_id',
- 'user_id' => 'user_id',
- 'completed' => 'completed',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'event_in_cart_id',
- 'event_id' => 'event_id',
- 'event_cart_id' => 'event_cart_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'title' => 'event_title',
- 'summary' => 'summary',
- 'description' => 'event_description',
- 'event_type_id' => 'event_type_id',
- 'participant_listing_id' => 'participant_listing_id',
- 'is_public' => 'is_public',
- 'start_date' => 'event_start_date',
- 'end_date' => 'event_end_date',
- 'is_online_registration' => 'is_online_registration',
- 'registration_link_text' => 'registration_link_text',
- 'registration_start_date' => 'registration_start_date',
- 'registration_end_date' => 'registration_end_date',
- 'max_participants' => 'max_participants',
- 'event_full_text' => 'event_full_text',
- 'is_monetary' => 'is_monetary',
- 'financial_type_id' => 'financial_type_id',
- 'payment_processor' => 'payment_processor',
- 'is_map' => 'is_map',
- 'is_active' => 'is_active',
- 'fee_label' => 'fee_label',
- 'is_show_location' => 'is_show_location',
- 'loc_block_id' => 'loc_block_id',
- 'default_role_id' => 'default_role_id',
- 'intro_text' => 'intro_text',
- 'footer_text' => 'footer_text',
- 'confirm_title' => 'confirm_title',
- 'confirm_text' => 'confirm_text',
- 'confirm_footer_text' => 'confirm_footer_text',
- 'is_email_confirm' => 'is_email_confirm',
- 'confirm_email_text' => 'confirm_email_text',
- 'confirm_from_name' => 'confirm_from_name',
- 'confirm_from_email' => 'confirm_from_email',
- 'cc_confirm' => 'cc_confirm',
- 'bcc_confirm' => 'bcc_confirm',
- 'default_fee_id' => 'default_fee_id',
- 'default_discount_fee_id' => 'default_discount_fee_id',
- 'thankyou_title' => 'thankyou_title',
- 'thankyou_text' => 'thankyou_text',
- 'thankyou_footer_text' => 'thankyou_footer_text',
- 'is_pay_later' => 'is_pay_later',
- 'pay_later_text' => 'pay_later_text',
- 'pay_later_receipt' => 'pay_later_receipt',
- 'is_partial_payment' => 'is_partial_payment',
- 'initial_amount_label' => 'initial_amount_label',
- 'initial_amount_help_text' => 'initial_amount_help_text',
- 'min_initial_amount' => 'min_initial_amount',
- 'is_multiple_registrations' => 'is_multiple_registrations',
- 'max_additional_participants' => 'max_additional_participants',
- 'allow_same_participant_emails' => 'allow_same_participant_emails',
- 'has_waitlist' => 'has_waitlist',
- 'requires_approval' => 'requires_approval',
- 'expiration_time' => 'expiration_time',
- 'allow_selfcancelxfer' => 'allow_selfcancelxfer',
- 'selfcancelxfer_time' => 'selfcancelxfer_time',
- 'waitlist_text' => 'waitlist_text',
- 'approval_req_text' => 'approval_req_text',
- 'is_template' => 'is_template',
- 'template_title' => 'template_title',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'currency' => 'currency',
- 'campaign_id' => 'campaign_id',
- 'is_share' => 'is_share',
- 'is_confirm_enabled' => 'is_confirm_enabled',
- 'parent_event_id' => 'parent_event_id',
- 'slot_label_id' => 'slot_label_id',
- 'dedupe_rule_group_id' => 'dedupe_rule_group_id',
- 'is_billing_required' => 'is_billing_required',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'participant_id',
- 'contact_id' => 'participant_contact_id',
- 'event_id' => 'event_id',
- 'status_id' => 'participant_status_id',
- 'role_id' => 'participant_role_id',
- 'register_date' => 'participant_register_date',
- 'source' => 'participant_source',
- 'fee_level' => 'participant_fee_level',
- 'is_test' => 'participant_is_test',
- 'is_pay_later' => 'participant_is_pay_later',
- 'fee_amount' => 'participant_fee_amount',
- 'registered_by_id' => 'participant_registered_by_id',
- 'discount_id' => 'participant_discount_id',
- 'fee_currency' => 'participant_fee_currency',
- 'campaign_id' => 'participant_campaign_id',
- 'discount_amount' => 'discount_amount',
- 'cart_id' => 'cart_id',
- 'must_wait' => 'must_wait',
- 'transferred_to_contact_id' => 'transferred_to_contact_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'participant_id' => 'participant_id',
- 'contribution_id' => 'contribution_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'participant_status',
- 'label' => 'label',
- 'class' => 'class',
- 'is_reserved' => 'is_reserved',
- 'is_active' => 'is_active',
- 'is_counted' => 'is_counted',
- 'weight' => 'weight',
- 'visibility_id' => 'visibility_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'symbol' => 'symbol',
- 'numeric_code' => 'numeric_code',
- 'full_name' => 'full_name',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'account_relationship' => 'account_relationship',
- 'financial_account_id' => 'financial_account_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'financial_trxn_id' => 'financial_trxn_id',
- 'amount' => 'amount',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'contact_id' => 'financial_account_contact_id',
- 'financial_account_type_id' => 'financial_account_type_id',
- 'accounting_code' => 'accounting_code',
- 'account_type_code' => 'account_type_code',
- 'description' => 'description',
- 'parent_id' => 'parent_id',
- 'is_header_account' => 'is_header_account',
- 'is_deductible' => 'is_deductible',
- 'is_tax' => 'is_tax',
- 'tax_rate' => 'tax_rate',
- 'is_reserved' => 'is_reserved',
- 'is_active' => 'is_active',
- 'is_default' => 'is_default',
- 'opening_balance' => 'opening_balance',
- 'current_period_opening_balance' => 'current_period_opening_balance',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'created_date' => 'created_date',
- 'transaction_date' => 'transaction_date',
- 'contact_id' => 'contact_id',
- 'description' => 'description',
- 'amount' => 'amount',
- 'currency' => 'currency',
- 'financial_account_id' => 'financial_account_id',
- 'status_id' => 'status_id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'from_financial_account_id' => 'from_financial_account_id',
- 'to_financial_account_id' => 'to_financial_account_id',
- 'trxn_date' => 'trxn_date',
- 'total_amount' => 'total_amount',
- 'fee_amount' => 'fee_amount',
- 'net_amount' => 'net_amount',
- 'currency' => 'currency',
- 'is_payment' => 'is_payment',
- 'trxn_id' => 'trxn_id',
- 'trxn_result_code' => 'trxn_result_code',
- 'status_id' => 'status_id',
- 'payment_processor_id' => 'payment_processor_id',
- 'payment_instrument_id' => 'financial_trxn_payment_instrument_id',
- 'check_number' => 'financial_trxn_check_number',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'financial_type',
- 'description' => 'description',
- 'is_deductible' => 'is_deductible',
- 'is_reserved' => 'is_reserved',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'name' => 'name',
- 'description' => 'description',
- 'payment_processor_type_id' => 'payment_processor_type_id',
- 'is_active' => 'is_active',
- 'is_default' => 'is_default',
- 'is_test' => 'is_test',
- 'user_name' => 'user_name',
- 'password' => 'password',
- 'signature' => 'signature',
- 'url_site' => 'url_site',
- 'url_api' => 'url_api',
- 'url_recur' => 'url_recur',
- 'url_button' => 'url_button',
- 'subject' => 'subject',
- 'class_name' => 'class_name',
- 'billing_mode' => 'billing_mode',
- 'is_recur' => 'is_recur',
- 'payment_type' => 'payment_type',
- 'payment_instrument_id' => 'payment_instrument_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'description' => 'description',
- 'is_active' => 'is_active',
- 'is_default' => 'is_default',
- 'user_name_label' => 'user_name_label',
- 'password_label' => 'password_label',
- 'signature_label' => 'signature_label',
- 'subject_label' => 'subject_label',
- 'class_name' => 'class_name',
- 'url_site_default' => 'url_site_default',
- 'url_api_default' => 'url_api_default',
- 'url_recur_default' => 'url_recur_default',
- 'url_button_default' => 'url_button_default',
- 'url_site_test_default' => 'url_site_test_default',
- 'url_api_test_default' => 'url_api_test_default',
- 'url_recur_test_default' => 'url_recur_test_default',
- 'url_button_test_default' => 'url_button_test_default',
- 'billing_mode' => 'billing_mode',
- 'is_recur' => 'is_recur',
- 'payment_type' => 'payment_type',
- 'payment_instrument_id' => 'payment_instrument_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'payment_token_id',
- 'contact_id' => 'contact_id',
- 'payment_processor_id' => 'payment_processor_id',
- 'token' => 'token',
- 'created_date' => 'created_date',
- 'created_id' => 'created_id',
- 'expiry_date' => 'expiry_date',
- 'email' => 'email',
- 'billing_first_name' => 'billing_first_name',
- 'billing_middle_name' => 'billing_middle_name',
- 'billing_last_name' => 'billing_last_name',
- 'masked_account_number' => 'masked_account_number',
- 'ip_address' => 'ip_address',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'title' => 'title',
- 'intro' => 'intro',
- 'suggested_message' => 'suggested_message',
- 'general_link' => 'general_link',
- 'thankyou_title' => 'thankyou_title',
- 'thankyou_text' => 'thankyou_text',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'grant_id',
- 'contact_id' => 'grant_contact_id',
- 'application_received_date' => 'application_received_date',
- 'decision_date' => 'decision_date',
- 'money_transfer_date' => 'grant_money_transfer_date',
- 'grant_due_date' => 'grant_due_date',
- 'grant_report_received' => 'grant_report_received',
- 'grant_type_id' => 'grant_type_id',
- 'amount_total' => 'amount_total',
- 'amount_requested' => 'amount_requested',
- 'amount_granted' => 'amount_granted',
- 'currency' => 'currency',
- 'rationale' => 'rationale',
- 'status_id' => 'grant_status_id',
- 'financial_type_id' => 'financial_type_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'bounce_type_id' => 'bounce_type_id',
- 'pattern' => 'pattern',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'description' => 'description',
- 'hold_threshold' => 'hold_threshold',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'component_type' => 'component_type',
- 'subject' => 'subject',
- 'body_html' => 'body_html',
- 'body_text' => 'body_text',
- 'is_default' => 'is_default',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'header_id' => 'header_id',
- 'footer_id' => 'footer_id',
- 'reply_id' => 'reply_id',
- 'unsubscribe_id' => 'unsubscribe_id',
- 'resubscribe_id' => 'resubscribe_id',
- 'optout_id' => 'optout_id',
- 'name' => 'name',
- 'mailing_type' => 'mailing_type',
- 'from_name' => 'from_name',
- 'from_email' => 'from_email',
- 'replyto_email' => 'replyto_email',
- 'subject' => 'subject',
- 'body_text' => 'body_text',
- 'body_html' => 'body_html',
- 'url_tracking' => 'url_tracking',
- 'forward_replies' => 'forward_replies',
- 'auto_responder' => 'auto_responder',
- 'open_tracking' => 'open_tracking',
- 'is_completed' => 'is_completed',
- 'msg_template_id' => 'msg_template_id',
- 'override_verp' => 'override_verp',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'scheduled_id' => 'scheduled_id',
- 'scheduled_date' => 'scheduled_date',
- 'approver_id' => 'approver_id',
- 'approval_date' => 'approval_date',
- 'approval_status_id' => 'approval_status_id',
- 'approval_note' => 'approval_note',
- 'is_archived' => 'is_archived',
- 'visibility' => 'visibility',
- 'campaign_id' => 'campaign_id',
- 'dedupe_email' => 'dedupe_email',
- 'sms_provider_id' => 'sms_provider_id',
- 'hash' => 'hash',
- 'location_type_id' => 'location_type_id',
- 'email_selection_method' => 'email_selection_method',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'status' => 'status',
- 'mailing_id_a' => 'mailing_id_a',
- 'mailing_id_b' => 'mailing_id_b',
- 'mailing_id_c' => 'mailing_id_c',
- 'domain_id' => 'domain_id',
- 'testing_criteria' => 'testing_criteria',
- 'winner_criteria' => 'winner_criteria',
- 'specific_url' => 'specific_url',
- 'declare_winning_time' => 'declare_winning_time',
- 'group_percentage' => 'group_percentage',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'mailing_id' => 'mailing_id',
- 'group_type' => 'group_type',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'search_id' => 'search_id',
- 'search_args' => 'search_args',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'mailing_id' => 'mailing_id',
- 'scheduled_date' => 'scheduled_date',
- 'start_date' => 'start_date',
- 'end_date' => 'end_date',
- 'status' => 'status',
- 'is_test' => 'is_test',
- 'job_type' => 'job_type',
- 'parent_id' => 'parent_id',
- 'job_offset' => 'job_offset',
- 'job_limit' => 'job_limit',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'mailing_id' => 'mailing_id',
- 'contact_id' => 'contact_id',
- 'email_id' => 'email_id',
- 'phone_id' => 'phone_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'job_id' => 'job_id',
- 'recipient_email' => 'recipient_email',
- 'headers' => 'headers',
- 'body' => 'body',
- 'added_at' => 'added_at',
- 'removed_at' => 'removed_at',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'url' => 'url',
- 'mailing_id' => 'mailing_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'event_queue_id' => 'event_queue_id',
- 'bounce_type_id' => 'bounce_type_id',
- 'bounce_reason' => 'bounce_reason',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'event_subscribe_id' => 'event_subscribe_id',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'event_queue_id' => 'event_queue_id',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'event_queue_id' => 'event_queue_id',
- 'dest_queue_id' => 'dest_queue_id',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'event_queue_id' => 'event_queue_id',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'job_id' => 'job_id',
- 'email_id' => 'email_id',
- 'contact_id' => 'contact_id',
- 'hash' => 'hash',
- 'phone_id' => 'phone_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'event_queue_id' => 'event_queue_id',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'group_id' => 'group_id',
- 'contact_id' => 'contact_id',
- 'hash' => 'hash',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'event_queue_id' => 'event_queue_id',
- 'trackable_url_id' => 'trackable_url_id',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'event_queue_id' => 'event_queue_id',
- 'org_unsubscribe' => 'org_unsubscribe',
- 'time_stamp' => 'time_stamp',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'membership_id',
- 'contact_id' => 'membership_contact_id',
- 'membership_type_id' => 'membership_type_id',
- 'join_date' => 'join_date',
- 'start_date' => 'membership_start_date',
- 'end_date' => 'membership_end_date',
- 'source' => 'membership_source',
- 'status_id' => 'status_id',
- 'is_override' => 'is_override',
- 'owner_membership_id' => 'owner_membership_id',
- 'max_related' => 'max_related',
- 'is_test' => 'member_is_test',
- 'is_pay_later' => 'member_is_pay_later',
- 'contribution_recur_id' => 'contribution_recur_id',
- 'campaign_id' => 'member_campaign_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'membership_types' => 'membership_types',
- 'membership_type_default' => 'membership_type_default',
- 'display_min_fee' => 'display_min_fee',
- 'is_separate_payment' => 'is_separate_payment',
- 'new_title' => 'new_title',
- 'new_text' => 'new_text',
- 'renewal_title' => 'renewal_title',
- 'renewal_text' => 'renewal_text',
- 'is_required' => 'is_required',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'membership_id' => 'membership_id',
- 'status_id' => 'status_id',
- 'start_date' => 'start_date',
- 'end_date' => 'end_date',
- 'modified_id' => 'modified_id',
- 'modified_date' => 'modified_date',
- 'membership_type_id' => 'membership_type_id',
- 'max_related' => 'max_related',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'membership_id' => 'membership_id',
- 'contribution_id' => 'contribution_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'membership_status',
- 'label' => 'label',
- 'start_event' => 'start_event',
- 'start_event_adjust_unit' => 'start_event_adjust_unit',
- 'start_event_adjust_interval' => 'start_event_adjust_interval',
- 'end_event' => 'end_event',
- 'end_event_adjust_unit' => 'end_event_adjust_unit',
- 'end_event_adjust_interval' => 'end_event_adjust_interval',
- 'is_current_member' => 'is_current_member',
- 'is_admin' => 'is_admin',
- 'weight' => 'weight',
- 'is_default' => 'is_default',
- 'is_active' => 'is_active',
- 'is_reserved' => 'is_reserved',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'name' => 'membership_type',
- 'description' => 'description',
- 'member_of_contact_id' => 'member_of_contact_id',
- 'financial_type_id' => 'financial_type_id',
- 'minimum_fee' => 'minimum_fee',
- 'duration_unit' => 'duration_unit',
- 'duration_interval' => 'duration_interval',
- 'period_type' => 'period_type',
- 'fixed_period_start_day' => 'fixed_period_start_day',
- 'fixed_period_rollover_day' => 'fixed_period_rollover_day',
- 'relationship_type_id' => 'relationship_type_id',
- 'relationship_direction' => 'relationship_direction',
- 'max_related' => 'max_related',
- 'visibility' => 'visibility',
- 'weight' => 'weight',
- 'receipt_text_signup' => 'receipt_text_signup',
- 'receipt_text_renewal' => 'receipt_text_renewal',
- 'auto_renew' => 'auto_renew',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'pcp_id',
- 'contact_id' => 'pcp_contact_id',
- 'status_id' => 'status_id',
- 'title' => 'title',
- 'intro_text' => 'intro_text',
- 'page_text' => 'page_text',
- 'donate_link_text' => 'donate_link_text',
- 'page_id' => 'page_id',
- 'page_type' => 'page_type',
- 'pcp_block_id' => 'pcp_block_id',
- 'is_thermometer' => 'is_thermometer',
- 'is_honor_roll' => 'is_honor_roll',
- 'goal_amount' => 'goal_amount',
- 'currency' => 'currency',
- 'is_active' => 'is_active',
- 'is_notify' => 'is_notify',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'target_entity_type' => 'target_entity_type',
- 'target_entity_id' => 'target_entity_id',
- 'supporter_profile_id' => 'supporter_profile_id',
- 'owner_notify_id' => 'owner_notify_id',
- 'is_approval_needed' => 'is_approval_needed',
- 'is_tellfriend_enabled' => 'is_tellfriend_enabled',
- 'tellfriend_limit' => 'tellfriend_limit',
- 'link_text' => 'link_text',
- 'is_active' => 'is_active',
- 'notify_email' => 'notify_email',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'pledge_id',
- 'contact_id' => 'pledge_contact_id',
- 'financial_type_id' => 'pledge_financial_type_id',
- 'contribution_page_id' => 'pledge_contribution_page_id',
- 'amount' => 'pledge_amount',
- 'original_installment_amount' => 'pledge_original_installment_amount',
- 'currency' => 'currency',
- 'frequency_unit' => 'pledge_frequency_unit',
- 'frequency_interval' => 'pledge_frequency_interval',
- 'frequency_day' => 'frequency_day',
- 'installments' => 'installments',
- 'start_date' => 'start_date',
- 'create_date' => 'pledge_create_date',
- 'acknowledge_date' => 'acknowledge_date',
- 'modified_date' => 'modified_date',
- 'cancel_date' => 'cancel_date',
- 'end_date' => 'end_date',
- 'max_reminders' => 'max_reminders',
- 'initial_reminder_day' => 'initial_reminder_day',
- 'additional_reminder_day' => 'additional_reminder_day',
- 'status_id' => 'pledge_status_id',
- 'is_test' => 'pledge_is_test',
- 'campaign_id' => 'pledge_campaign_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'pledge_frequency_unit' => 'pledge_frequency_unit',
- 'is_pledge_interval' => 'is_pledge_interval',
- 'max_reminders' => 'max_reminders',
- 'initial_reminder_day' => 'initial_reminder_day',
- 'additional_reminder_day' => 'additional_reminder_day',
- 'pledge_start_date' => 'pledge_start_date',
- 'is_pledge_start_date_visible' => 'is_pledge_start_date_visible',
- 'is_pledge_start_date_editable' => 'is_pledge_start_date_editable',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'pledge_payment_id',
- 'pledge_id' => 'pledge_id',
- 'contribution_id' => 'contribution_id',
- 'scheduled_amount' => 'pledge_payment_scheduled_amount',
- 'actual_amount' => 'pledge_payment_actual_amount',
- 'currency' => 'currency',
- 'scheduled_date' => 'pledge_payment_scheduled_date',
- 'reminder_date' => 'pledge_payment_reminder_date',
- 'reminder_count' => 'pledge_payment_reminder_count',
- 'status_id' => 'pledge_payment_status_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'contribution_id' => 'contribution_id',
- 'price_field_id' => 'price_field_id',
- 'label' => 'label',
- 'qty' => 'qty',
- 'unit_price' => 'unit_price',
- 'line_total' => 'line_total',
- 'participant_count' => 'participant_count',
- 'price_field_value_id' => 'price_field_value_id',
- 'financial_type_id' => 'financial_type_id',
- 'deductible_amount' => 'deductible_amount',
- 'tax_amount' => 'tax_amount',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'price_set_id' => 'price_set_id',
- 'name' => 'name',
- 'label' => 'label',
- 'html_type' => 'html_type',
- 'is_enter_qty' => 'is_enter_qty',
- 'help_pre' => 'help_pre',
- 'help_post' => 'help_post',
- 'weight' => 'weight',
- 'is_display_amounts' => 'is_display_amounts',
- 'options_per_line' => 'options_per_line',
- 'is_active' => 'is_active',
- 'is_required' => 'is_required',
- 'active_on' => 'active_on',
- 'expire_on' => 'expire_on',
- 'javascript' => 'javascript',
- 'visibility_id' => 'visibility_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'price_field_id' => 'price_field_id',
- 'name' => 'name',
- 'label' => 'label',
- 'description' => 'description',
- 'help_pre' => 'help_pre',
- 'help_post' => 'help_post',
- 'amount' => 'amount',
- 'count' => 'count',
- 'max_value' => 'max_value',
- 'weight' => 'weight',
- 'membership_type_id' => 'membership_type_id',
- 'membership_num_terms' => 'membership_num_terms',
- 'is_default' => 'is_default',
- 'is_active' => 'is_active',
- 'financial_type_id' => 'financial_type_id',
- 'deductible_amount' => 'deductible_amount',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'name' => 'name',
- 'title' => 'title',
- 'is_active' => 'is_active',
- 'help_pre' => 'help_pre',
- 'help_post' => 'help_post',
- 'javascript' => 'javascript',
- 'extends' => 'extends',
- 'financial_type_id' => 'financial_type_id',
- 'is_quick_config' => 'is_quick_config',
- 'is_reserved' => 'is_reserved',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'entity_table' => 'entity_table',
- 'entity_id' => 'entity_id',
- 'price_set_id' => 'price_set_id',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'queue_name' => 'queue_name',
- 'weight' => 'weight',
- 'submit_time' => 'submit_time',
- 'release_time' => 'release_time',
- 'data' => 'data',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'domain_id' => 'domain_id',
- 'title' => 'title',
- 'report_id' => 'report_id',
- 'name' => 'name',
- 'args' => 'args',
- 'description' => 'description',
- 'permission' => 'permission',
- 'grouprole' => 'grouprole',
- 'form_values' => 'form_values',
- 'is_active' => 'is_active',
- 'created_id' => 'created_id',
- 'owner_id' => 'owner_id',
- 'email_subject' => 'email_subject',
- 'email_to' => 'email_to',
- 'email_cc' => 'email_cc',
- 'header' => 'header',
- 'footer' => 'footer',
- 'navigation_id' => 'navigation_id',
- 'drilldown_id' => 'drilldown_id',
- 'is_reserved' => 'is_reserved',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @var array
*/
static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
/**
* static instance to hold the FK relationships
*
return self::$_fields;
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'username' => 'username',
- 'password' => 'password',
- 'api_type' => 'api_type',
- 'api_url' => 'api_url',
- 'api_params' => 'api_params',
- 'is_default' => 'is_default',
- 'is_active' => 'is_active',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table