[REF] Extract determination of subscription status information
[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:47ce2c9d196b195fda0a60eaac02f5d1)
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 * @param bool $plural
59 * Whether to return the plural version of the title.
60 */
61 public static function getEntityTitle($plural = FALSE) {
62 return $plural ? ts('Address Formats') : ts('Address Format');
63 }
64
65 /**
66 * Returns all the column names of this table
67 *
68 * @return array
69 */
70 public static function &fields() {
71 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
72 Civi::$statics[__CLASS__]['fields'] = [
73 'id' => [
74 'name' => 'id',
75 'type' => CRM_Utils_Type::T_INT,
76 'title' => ts('Address Format ID'),
77 'description' => ts('Address Format Id'),
78 'required' => TRUE,
79 'where' => 'civicrm_address_format.id',
80 'table_name' => 'civicrm_address_format',
81 'entity' => 'AddressFormat',
82 'bao' => 'CRM_Core_DAO_AddressFormat',
83 'localizable' => 0,
84 'add' => '3.2',
85 ],
86 'format' => [
87 'name' => 'format',
88 'type' => CRM_Utils_Type::T_TEXT,
89 'title' => ts('Address Format'),
90 'description' => ts('The format of an address'),
91 'where' => 'civicrm_address_format.format',
92 'table_name' => 'civicrm_address_format',
93 'entity' => 'AddressFormat',
94 'bao' => 'CRM_Core_DAO_AddressFormat',
95 'localizable' => 0,
96 'add' => '3.2',
97 ],
98 ];
99 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
100 }
101 return Civi::$statics[__CLASS__]['fields'];
102 }
103
104 /**
105 * Return a mapping from field-name to the corresponding key (as used in fields()).
106 *
107 * @return array
108 * Array(string $name => string $uniqueName).
109 */
110 public static function &fieldKeys() {
111 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
112 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
113 }
114 return Civi::$statics[__CLASS__]['fieldKeys'];
115 }
116
117 /**
118 * Returns the names of this table
119 *
120 * @return string
121 */
122 public static function getTableName() {
123 return self::$_tableName;
124 }
125
126 /**
127 * Returns if this table needs to be logged
128 *
129 * @return bool
130 */
131 public function getLog() {
132 return self::$_log;
133 }
134
135 /**
136 * Returns the list of fields that can be imported
137 *
138 * @param bool $prefix
139 *
140 * @return array
141 */
142 public static function &import($prefix = FALSE) {
143 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'address_format', $prefix, []);
144 return $r;
145 }
146
147 /**
148 * Returns the list of fields that can be exported
149 *
150 * @param bool $prefix
151 *
152 * @return array
153 */
154 public static function &export($prefix = FALSE) {
155 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'address_format', $prefix, []);
156 return $r;
157 }
158
159 /**
160 * Returns the list of indices
161 *
162 * @param bool $localize
163 *
164 * @return array
165 */
166 public static function indices($localize = TRUE) {
167 $indices = [];
168 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
169 }
170
171 }