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