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