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