5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/County.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:deaadd903f7cfee93f6b70fb2e9fc012)
13 * Database access object for the County entity.
15 class CRM_Core_DAO_County
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_county';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
46 * 2-4 Character Abbreviation of County
53 * ID of State/Province that County belongs
57 public $state_province_id;
62 public function __construct() {
63 $this->__table
= 'civicrm_county';
64 parent
::__construct();
68 * Returns foreign keys and entity references.
71 * [CRM_Core_Reference_Interface]
73 public static function getReferenceColumns() {
74 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
75 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
76 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'state_province_id', 'civicrm_state_province', 'id');
77 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
79 return Civi
::$statics[__CLASS__
]['links'];
83 * Returns all the column names of this table
87 public static function &fields() {
88 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
89 Civi
::$statics[__CLASS__
]['fields'] = [
92 'type' => CRM_Utils_Type
::T_INT
,
93 'title' => ts('County ID'),
94 'description' => 'County ID',
96 'table_name' => 'civicrm_county',
98 'bao' => 'CRM_Core_DAO_County',
103 'type' => CRM_Utils_Type
::T_STRING
,
104 'title' => ts('County'),
105 'description' => 'Name of County',
107 'size' => CRM_Utils_Type
::BIG
,
109 'where' => 'civicrm_county.name',
110 'headerPattern' => '/county/i',
111 'dataPattern' => '/[A-Z]{2}/',
113 'table_name' => 'civicrm_county',
114 'entity' => 'County',
115 'bao' => 'CRM_Core_DAO_County',
119 'name' => 'abbreviation',
120 'type' => CRM_Utils_Type
::T_STRING
,
121 'title' => ts('County Abbreviation'),
122 'description' => '2-4 Character Abbreviation of County',
124 'size' => CRM_Utils_Type
::FOUR
,
125 'table_name' => 'civicrm_county',
126 'entity' => 'County',
127 'bao' => 'CRM_Core_DAO_County',
130 'state_province_id' => [
131 'name' => 'state_province_id',
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('State'),
134 'description' => 'ID of State/Province that County belongs',
136 'table_name' => 'civicrm_county',
137 'entity' => 'County',
138 'bao' => 'CRM_Core_DAO_County',
140 'FKClassName' => 'CRM_Core_DAO_StateProvince',
143 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
145 return Civi
::$statics[__CLASS__
]['fields'];
149 * Return a mapping from field-name to the corresponding key (as used in fields()).
152 * Array(string $name => string $uniqueName).
154 public static function &fieldKeys() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
156 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
158 return Civi
::$statics[__CLASS__
]['fieldKeys'];
162 * Returns the names of this table
166 public static function getTableName() {
167 return self
::$_tableName;
171 * Returns if this table needs to be logged
175 public function getLog() {
180 * Returns the list of fields that can be imported
182 * @param bool $prefix
186 public static function &import($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'county', $prefix, []);
192 * Returns the list of fields that can be exported
194 * @param bool $prefix
198 public static function &export($prefix = FALSE) {
199 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'county', $prefix, []);
204 * Returns the list of indices
206 * @param bool $localize
210 public static function indices($localize = TRUE) {
212 'UI_name_state_id' => [
213 'name' => 'UI_name_state_id',
216 1 => 'state_province_id',
218 'localizable' => FALSE,
220 'sig' => 'civicrm_county::1::name::state_province_id',
223 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;