Merge pull request #22631 from braders/calculateBaseScheduleDate-docblock
[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:bdb3bcc498465d39e8bd700f5c3b64df)
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|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
39 */
40 public $id;
41
42 /**
43 * The format of an address
44 *
45 * @var string|null
46 * (SQL type: text)
47 * Note that values will be retrieved from the database as a string.
48 */
49 public $format;
50
51 /**
52 * Class constructor.
53 */
54 public function __construct() {
55 $this->__table = 'civicrm_address_format';
56 parent::__construct();
57 }
58
59 /**
60 * Returns localized title of this entity.
61 *
62 * @param bool $plural
63 * Whether to return the plural version of the title.
64 */
65 public static function getEntityTitle($plural = FALSE) {
66 return $plural ? ts('Address Formats') : ts('Address Format');
67 }
68
69 /**
70 * Returns all the column names of this table
71 *
72 * @return array
73 */
74 public static function &fields() {
75 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
76 Civi::$statics[__CLASS__]['fields'] = [
77 'id' => [
78 'name' => 'id',
79 'type' => CRM_Utils_Type::T_INT,
80 'title' => ts('Address Format ID'),
81 'description' => ts('Address Format ID'),
82 'required' => TRUE,
83 'where' => 'civicrm_address_format.id',
84 'table_name' => 'civicrm_address_format',
85 'entity' => 'AddressFormat',
86 'bao' => 'CRM_Core_DAO_AddressFormat',
87 'localizable' => 0,
88 'html' => [
89 'type' => 'Number',
90 ],
91 'readonly' => TRUE,
92 'add' => '3.2',
93 ],
94 'format' => [
95 'name' => 'format',
96 'type' => CRM_Utils_Type::T_TEXT,
97 'title' => ts('Address Format'),
98 'description' => ts('The format of an address'),
99 'where' => 'civicrm_address_format.format',
100 'table_name' => 'civicrm_address_format',
101 'entity' => 'AddressFormat',
102 'bao' => 'CRM_Core_DAO_AddressFormat',
103 'localizable' => 0,
104 'add' => '3.2',
105 ],
106 ];
107 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
108 }
109 return Civi::$statics[__CLASS__]['fields'];
110 }
111
112 /**
113 * Return a mapping from field-name to the corresponding key (as used in fields()).
114 *
115 * @return array
116 * Array(string $name => string $uniqueName).
117 */
118 public static function &fieldKeys() {
119 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
120 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
121 }
122 return Civi::$statics[__CLASS__]['fieldKeys'];
123 }
124
125 /**
126 * Returns the names of this table
127 *
128 * @return string
129 */
130 public static function getTableName() {
131 return self::$_tableName;
132 }
133
134 /**
135 * Returns if this table needs to be logged
136 *
137 * @return bool
138 */
139 public function getLog() {
140 return self::$_log;
141 }
142
143 /**
144 * Returns the list of fields that can be imported
145 *
146 * @param bool $prefix
147 *
148 * @return array
149 */
150 public static function &import($prefix = FALSE) {
151 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'address_format', $prefix, []);
152 return $r;
153 }
154
155 /**
156 * Returns the list of fields that can be exported
157 *
158 * @param bool $prefix
159 *
160 * @return array
161 */
162 public static function &export($prefix = FALSE) {
163 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'address_format', $prefix, []);
164 return $r;
165 }
166
167 /**
168 * Returns the list of indices
169 *
170 * @param bool $localize
171 *
172 * @return array
173 */
174 public static function indices($localize = TRUE) {
175 $indices = [];
176 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
177 }
178
179 }