Translate description in DAO files
[civicrm-core.git] / CRM / Financial / DAO / FinancialType.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Financial/FinancialType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6d85bc0675253407de19ac9226ba4478)
10 */
11
12 /**
13 * Database access object for the FinancialType entity.
14 */
15 class CRM_Financial_DAO_FinancialType extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_financial_type';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = TRUE;
30
31 /**
32 * ID of original financial_type so you can search this table by the financial_type.id and then select the relevant version based on the timestamp
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Financial Type Name.
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Financial Type Description.
47 *
48 * @var string
49 */
50 public $description;
51
52 /**
53 * Is this financial type tax-deductible? If true, contributions of this type may be fully OR partially deductible - non-deductible amount is stored in the Contribution record.
54 *
55 * @var boolean
56 */
57 public $is_deductible;
58
59 /**
60 * Is this a predefined system object?
61 *
62 * @var boolean
63 */
64 public $is_reserved;
65
66 /**
67 * Is this property active?
68 *
69 * @var boolean
70 */
71 public $is_active;
72
73 /**
74 * Class constructor.
75 */
76 public function __construct() {
77 $this->__table = 'civicrm_financial_type';
78 parent::__construct();
79 }
80
81 /**
82 * Returns all the column names of this table
83 *
84 * @return array
85 */
86 public static function &fields() {
87 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
88 Civi::$statics[__CLASS__]['fields'] = [
89 'id' => [
90 'name' => 'id',
91 'type' => CRM_Utils_Type::T_INT,
92 'title' => ts('Financial Type ID'),
93 'description' => ts('ID of original financial_type so you can search this table by the financial_type.id and then select the relevant version based on the timestamp'),
94 'required' => TRUE,
95 'table_name' => 'civicrm_financial_type',
96 'entity' => 'FinancialType',
97 'bao' => 'CRM_Financial_BAO_FinancialType',
98 'localizable' => 0,
99 ],
100 'financial_type' => [
101 'name' => 'name',
102 'type' => CRM_Utils_Type::T_STRING,
103 'title' => ts('Financial Type'),
104 'description' => ts('Financial Type Name.'),
105 'required' => TRUE,
106 'maxlength' => 64,
107 'size' => CRM_Utils_Type::BIG,
108 'import' => TRUE,
109 'where' => 'civicrm_financial_type.name',
110 'headerPattern' => '/(finan(cial)?)?type/i',
111 'dataPattern' => '/donation|member|campaign/i',
112 'export' => TRUE,
113 'table_name' => 'civicrm_financial_type',
114 'entity' => 'FinancialType',
115 'bao' => 'CRM_Financial_BAO_FinancialType',
116 'localizable' => 0,
117 'html' => [
118 'type' => 'Text',
119 'label' => ts("Name"),
120 ],
121 'pseudoconstant' => [
122 'table' => 'civicrm_financial_type',
123 'keyColumn' => 'id',
124 'labelColumn' => 'name',
125 ]
126 ],
127 'description' => [
128 'name' => 'description',
129 'type' => CRM_Utils_Type::T_STRING,
130 'title' => ts('Description'),
131 'description' => ts('Financial Type Description.'),
132 'maxlength' => 255,
133 'size' => CRM_Utils_Type::HUGE,
134 'table_name' => 'civicrm_financial_type',
135 'entity' => 'FinancialType',
136 'bao' => 'CRM_Financial_BAO_FinancialType',
137 'localizable' => 0,
138 'html' => [
139 'type' => 'TextArea',
140 'label' => ts("Description"),
141 ],
142 ],
143 'is_deductible' => [
144 'name' => 'is_deductible',
145 'type' => CRM_Utils_Type::T_BOOLEAN,
146 'title' => ts('Is Tax Deductible?'),
147 'description' => ts('Is this financial type tax-deductible? If true, contributions of this type may be fully OR partially deductible - non-deductible amount is stored in the Contribution record.'),
148 'default' => '1',
149 'table_name' => 'civicrm_financial_type',
150 'entity' => 'FinancialType',
151 'bao' => 'CRM_Financial_BAO_FinancialType',
152 'localizable' => 0,
153 'html' => [
154 'type' => 'CheckBox',
155 'label' => ts("Tax-Deductible?"),
156 ],
157 ],
158 'is_reserved' => [
159 'name' => 'is_reserved',
160 'type' => CRM_Utils_Type::T_BOOLEAN,
161 'title' => ts('Financial Type is Reserved?'),
162 'description' => ts('Is this a predefined system object?'),
163 'table_name' => 'civicrm_financial_type',
164 'entity' => 'FinancialType',
165 'bao' => 'CRM_Financial_BAO_FinancialType',
166 'localizable' => 0,
167 'html' => [
168 'type' => 'CheckBox',
169 'label' => ts("Reserved?"),
170 ],
171 ],
172 'is_active' => [
173 'name' => 'is_active',
174 'type' => CRM_Utils_Type::T_BOOLEAN,
175 'title' => ts('Financial Type Is Active?'),
176 'description' => ts('Is this property active?'),
177 'table_name' => 'civicrm_financial_type',
178 'entity' => 'FinancialType',
179 'bao' => 'CRM_Financial_BAO_FinancialType',
180 'localizable' => 0,
181 'html' => [
182 'type' => 'CheckBox',
183 'label' => ts("Enabled?"),
184 ],
185 ],
186 ];
187 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
188 }
189 return Civi::$statics[__CLASS__]['fields'];
190 }
191
192 /**
193 * Return a mapping from field-name to the corresponding key (as used in fields()).
194 *
195 * @return array
196 * Array(string $name => string $uniqueName).
197 */
198 public static function &fieldKeys() {
199 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
200 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
201 }
202 return Civi::$statics[__CLASS__]['fieldKeys'];
203 }
204
205 /**
206 * Returns the names of this table
207 *
208 * @return string
209 */
210 public static function getTableName() {
211 return self::$_tableName;
212 }
213
214 /**
215 * Returns if this table needs to be logged
216 *
217 * @return bool
218 */
219 public function getLog() {
220 return self::$_log;
221 }
222
223 /**
224 * Returns the list of fields that can be imported
225 *
226 * @param bool $prefix
227 *
228 * @return array
229 */
230 public static function &import($prefix = FALSE) {
231 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'financial_type', $prefix, []);
232 return $r;
233 }
234
235 /**
236 * Returns the list of fields that can be exported
237 *
238 * @param bool $prefix
239 *
240 * @return array
241 */
242 public static function &export($prefix = FALSE) {
243 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'financial_type', $prefix, []);
244 return $r;
245 }
246
247 /**
248 * Returns the list of indices
249 *
250 * @param bool $localize
251 *
252 * @return array
253 */
254 public static function indices($localize = TRUE) {
255 $indices = [
256 'UI_id' => [
257 'name' => 'UI_id',
258 'field' => [
259 0 => 'id',
260 ],
261 'localizable' => FALSE,
262 'unique' => TRUE,
263 'sig' => 'civicrm_financial_type::1::id',
264 ],
265 ];
266 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
267 }
268
269 }