Merge pull request #14326 from civicrm/5.14
[civicrm-core.git] / CRM / Core / DAO / AddressFormat.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/AddressFormat.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:144542b9aa31391600f73d885f819091)
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 all the column names of this table
55 *
56 * @return array
57 */
58 public static function &fields() {
59 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
60 Civi::$statics[__CLASS__]['fields'] = [
61 'id' => [
62 'name' => 'id',
63 'type' => CRM_Utils_Type::T_INT,
64 'title' => ts('Address Format ID'),
65 'description' => ts('Address Format Id'),
66 'required' => TRUE,
67 'where' => 'civicrm_address_format.id',
68 'table_name' => 'civicrm_address_format',
69 'entity' => 'AddressFormat',
70 'bao' => 'CRM_Core_DAO_AddressFormat',
71 'localizable' => 0,
72 ],
73 'format' => [
74 'name' => 'format',
75 'type' => CRM_Utils_Type::T_TEXT,
76 'title' => ts('Address Format'),
77 'description' => ts('The format of an address'),
78 'where' => 'civicrm_address_format.format',
79 'table_name' => 'civicrm_address_format',
80 'entity' => 'AddressFormat',
81 'bao' => 'CRM_Core_DAO_AddressFormat',
82 'localizable' => 0,
83 ],
84 ];
85 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
86 }
87 return Civi::$statics[__CLASS__]['fields'];
88 }
89
90 /**
91 * Return a mapping from field-name to the corresponding key (as used in fields()).
92 *
93 * @return array
94 * Array(string $name => string $uniqueName).
95 */
96 public static function &fieldKeys() {
97 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
98 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
99 }
100 return Civi::$statics[__CLASS__]['fieldKeys'];
101 }
102
103 /**
104 * Returns the names of this table
105 *
106 * @return string
107 */
108 public static function getTableName() {
109 return self::$_tableName;
110 }
111
112 /**
113 * Returns if this table needs to be logged
114 *
115 * @return bool
116 */
117 public function getLog() {
118 return self::$_log;
119 }
120
121 /**
122 * Returns the list of fields that can be imported
123 *
124 * @param bool $prefix
125 *
126 * @return array
127 */
128 public static function &import($prefix = FALSE) {
129 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'address_format', $prefix, []);
130 return $r;
131 }
132
133 /**
134 * Returns the list of fields that can be exported
135 *
136 * @param bool $prefix
137 *
138 * @return array
139 */
140 public static function &export($prefix = FALSE) {
141 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'address_format', $prefix, []);
142 return $r;
143 }
144
145 /**
146 * Returns the list of indices
147 *
148 * @param bool $localize
149 *
150 * @return array
151 */
152 public static function indices($localize = TRUE) {
153 $indices = [];
154 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
155 }
156
157 }