Merge pull request #13258 from eileenmcnaughton/isam
[civicrm-core.git] / CRM / Core / DAO / Worldregion.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
8c9251b3 5 * @copyright CiviCRM LLC (c) 2004-2018
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/Worldregion.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e380ee3b 9 * (GenCodeChecksum:f326bc6047454a630b352baf190b0cac)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Worldregion entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_Worldregion extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_worldregion';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
c3fc2621
CW
29 static $_log = FALSE;
30
e501603b
TO
31 /**
32 * Country Id
33 *
34 * @var int unsigned
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * Region name to be associated with countries
40 *
41 * @var string
42 */
43 public $name;
c3fc2621 44
e501603b 45 /**
f41f0342 46 * Class constructor.
e501603b 47 */
c3fc2621 48 public function __construct() {
e501603b
TO
49 $this->__table = 'civicrm_worldregion';
50 parent::__construct();
51 }
c3fc2621 52
e501603b
TO
53 /**
54 * Returns all the column names of this table
55 *
56 * @return array
57 */
c3fc2621 58 public static function &fields() {
346aaaba 59 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
60 Civi::$statics[__CLASS__]['fields'] = [
61 'id' => [
e501603b
TO
62 'name' => 'id',
63 'type' => CRM_Utils_Type::T_INT,
c3fc2621 64 'title' => ts('World Region ID'),
215b423e 65 'description' => ts('Country Id'),
c3fc2621 66 'required' => TRUE,
522a26c9 67 'table_name' => 'civicrm_worldregion',
68 'entity' => 'Worldregion',
69 'bao' => 'CRM_Core_DAO_Worldregion',
6a7e5e5d 70 'localizable' => 0,
c3fc2621
CW
71 ],
72 'world_region' => [
e501603b
TO
73 'name' => 'name',
74 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 75 'title' => ts('World Region'),
215b423e 76 'description' => ts('Region name to be associated with countries'),
e501603b
TO
77 'maxlength' => 128,
78 'size' => CRM_Utils_Type::HUGE,
c3fc2621 79 'export' => TRUE,
e501603b
TO
80 'where' => 'civicrm_worldregion.name',
81 'headerPattern' => '',
82 'dataPattern' => '',
522a26c9 83 'table_name' => 'civicrm_worldregion',
84 'entity' => 'Worldregion',
85 'bao' => 'CRM_Core_DAO_Worldregion',
6a7e5e5d 86 'localizable' => 0,
c3fc2621
CW
87 ],
88 ];
346aaaba 89 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 90 }
346aaaba 91 return Civi::$statics[__CLASS__]['fields'];
e501603b 92 }
c3fc2621 93
e501603b 94 /**
bd8e0b14 95 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
96 *
97 * @return array
bd8e0b14 98 * Array(string $name => string $uniqueName).
e501603b 99 */
c3fc2621 100 public static function &fieldKeys() {
bd8e0b14
TO
101 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
102 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 103 }
bd8e0b14 104 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 105 }
c3fc2621 106
e501603b
TO
107 /**
108 * Returns the names of this table
109 *
110 * @return string
111 */
c3fc2621 112 public static function getTableName() {
e501603b
TO
113 return self::$_tableName;
114 }
c3fc2621 115
e501603b
TO
116 /**
117 * Returns if this table needs to be logged
118 *
c3fc2621 119 * @return bool
e501603b 120 */
c3fc2621 121 public function getLog() {
e501603b
TO
122 return self::$_log;
123 }
c3fc2621 124
e501603b
TO
125 /**
126 * Returns the list of fields that can be imported
127 *
128 * @param bool $prefix
129 *
130 * @return array
131 */
c3fc2621
CW
132 public static function &import($prefix = FALSE) {
133 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'worldregion', $prefix, []);
60808919 134 return $r;
e501603b 135 }
c3fc2621 136
e501603b
TO
137 /**
138 * Returns the list of fields that can be exported
139 *
140 * @param bool $prefix
141 *
142 * @return array
143 */
c3fc2621
CW
144 public static function &export($prefix = FALSE) {
145 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'worldregion', $prefix, []);
60808919 146 return $r;
e501603b 147 }
c3fc2621 148
e7a6b91a
AS
149 /**
150 * Returns the list of indices
c3fc2621
CW
151 *
152 * @param bool $localize
153 *
154 * @return array
e7a6b91a
AS
155 */
156 public static function indices($localize = TRUE) {
c3fc2621 157 $indices = [];
e7a6b91a
AS
158 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
159 }
c3fc2621 160
e501603b 161}