Declare API Key as a protected field for future use
[civicrm-core.git] / CRM / Member / DAO / MembershipType.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Member/MembershipType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
042043f1 9 * (GenCodeChecksum:1ba536f752a8ec059b59ccbc16343675)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the MembershipType entity.
f41f0342 14 */
e501603b 15class CRM_Member_DAO_MembershipType extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
fa45b5b9 22 public static $_tableName = 'civicrm_membership_type';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
fa45b5b9 29 public static $_log = TRUE;
c3fc2621 30
e501603b
TO
31 /**
32 * Membership Id
33 *
34 * @var int unsigned
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * Which Domain is this match entry for
40 *
41 * @var int unsigned
42 */
43 public $domain_id;
c3fc2621 44
e501603b
TO
45 /**
46 * Name of Membership Type
47 *
48 * @var string
49 */
50 public $name;
c3fc2621 51
e501603b
TO
52 /**
53 * Description of Membership Type
54 *
55 * @var string
56 */
57 public $description;
c3fc2621 58
e501603b
TO
59 /**
60 * Owner organization for this membership type. FK to Contact ID
61 *
62 * @var int unsigned
63 */
64 public $member_of_contact_id;
c3fc2621 65
e501603b
TO
66 /**
67 * If membership is paid by a contribution - what financial type should be used. FK to civicrm_financial_type.id
68 *
69 * @var int unsigned
70 */
71 public $financial_type_id;
c3fc2621 72
e501603b
TO
73 /**
74 * Minimum fee for this membership (0 for free/complimentary memberships).
75 *
76 * @var float
77 */
78 public $minimum_fee;
c3fc2621 79
e501603b
TO
80 /**
81 * Unit in which membership period is expressed.
82 *
83 * @var string
84 */
85 public $duration_unit;
c3fc2621 86
e501603b
TO
87 /**
88 * Number of duration units in membership period (e.g. 1 year, 12 months).
89 *
90 * @var int
91 */
92 public $duration_interval;
c3fc2621 93
e501603b
TO
94 /**
95 * Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.
96 *
97 * @var string
98 */
99 public $period_type;
c3fc2621 100
e501603b
TO
101 /**
102 * For fixed period memberships, month and day (mmdd) on which subscription/membership will start. Period start is back-dated unless after rollover day.
103 *
104 * @var int
105 */
106 public $fixed_period_start_day;
c3fc2621 107
e501603b
TO
108 /**
109 * For fixed period memberships, signups after this day (mmdd) rollover to next period.
110 *
111 * @var int
112 */
113 public $fixed_period_rollover_day;
c3fc2621 114
e501603b
TO
115 /**
116 * FK to Relationship Type ID
117 *
118 * @var string
119 */
120 public $relationship_type_id;
c3fc2621 121
e501603b 122 /**
e501603b
TO
123 * @var string
124 */
125 public $relationship_direction;
c3fc2621 126
e501603b
TO
127 /**
128 * Maximum number of related memberships.
129 *
130 * @var int
131 */
132 public $max_related;
c3fc2621 133
e501603b 134 /**
e501603b
TO
135 * @var string
136 */
137 public $visibility;
c3fc2621 138
e501603b 139 /**
e501603b
TO
140 * @var int
141 */
142 public $weight;
c3fc2621 143
e501603b
TO
144 /**
145 * Receipt Text for membership signup
146 *
147 * @var string
148 */
149 public $receipt_text_signup;
c3fc2621 150
e501603b
TO
151 /**
152 * Receipt Text for membership renewal
153 *
154 * @var string
155 */
156 public $receipt_text_renewal;
c3fc2621 157
e501603b
TO
158 /**
159 * 0 = No auto-renew option; 1 = Give option, but not required; 2 = Auto-renew required;
160 *
161 * @var boolean
162 */
163 public $auto_renew;
c3fc2621 164
e501603b
TO
165 /**
166 * Is this membership_type enabled
167 *
168 * @var boolean
169 */
170 public $is_active;
c3fc2621 171
e501603b 172 /**
f41f0342 173 * Class constructor.
e501603b 174 */
c3fc2621 175 public function __construct() {
e501603b
TO
176 $this->__table = 'civicrm_membership_type';
177 parent::__construct();
178 }
c3fc2621 179
e501603b 180 /**
f41f0342 181 * Returns foreign keys and entity references.
e501603b
TO
182 *
183 * @return array
184 * [CRM_Core_Reference_Interface]
185 */
c3fc2621 186 public static function getReferenceColumns() {
346aaaba 187 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 188 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
189 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
190 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'member_of_contact_id', 'civicrm_contact', 'id');
191 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
346aaaba 192 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 193 }
346aaaba 194 return Civi::$statics[__CLASS__]['links'];
e501603b 195 }
c3fc2621 196
e501603b
TO
197 /**
198 * Returns all the column names of this table
199 *
200 * @return array
201 */
c3fc2621 202 public static function &fields() {
346aaaba 203 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
204 Civi::$statics[__CLASS__]['fields'] = [
205 'id' => [
e501603b
TO
206 'name' => 'id',
207 'type' => CRM_Utils_Type::T_INT,
c3fc2621 208 'title' => ts('Membership Type ID'),
215b423e 209 'description' => ts('Membership Id'),
c3fc2621 210 'required' => TRUE,
a36434b9 211 'where' => 'civicrm_membership_type.id',
522a26c9 212 'table_name' => 'civicrm_membership_type',
213 'entity' => 'MembershipType',
214 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 215 'localizable' => 0,
c3fc2621
CW
216 ],
217 'domain_id' => [
e501603b
TO
218 'name' => 'domain_id',
219 'type' => CRM_Utils_Type::T_INT,
c3fc2621 220 'title' => ts('Membership Type Domain'),
215b423e 221 'description' => ts('Which Domain is this match entry for'),
c3fc2621 222 'required' => TRUE,
a36434b9 223 'where' => 'civicrm_membership_type.domain_id',
522a26c9 224 'table_name' => 'civicrm_membership_type',
225 'entity' => 'MembershipType',
226 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 227 'localizable' => 0,
e501603b 228 'FKClassName' => 'CRM_Core_DAO_Domain',
c3fc2621 229 'pseudoconstant' => [
e501603b
TO
230 'table' => 'civicrm_domain',
231 'keyColumn' => 'id',
232 'labelColumn' => 'name',
c3fc2621
CW
233 ]
234 ],
235 'membership_type' => [
e501603b
TO
236 'name' => 'name',
237 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 238 'title' => ts('Membership Type'),
215b423e 239 'description' => ts('Name of Membership Type'),
e501603b
TO
240 'maxlength' => 128,
241 'size' => CRM_Utils_Type::HUGE,
c3fc2621 242 'import' => TRUE,
e501603b 243 'where' => 'civicrm_membership_type.name',
c3fc2621 244 'export' => TRUE,
522a26c9 245 'table_name' => 'civicrm_membership_type',
246 'entity' => 'MembershipType',
247 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 248 'localizable' => 1,
6f85d058 249 'html' => [
250 'type' => 'Text',
4361de53 251 'label' => ts("Name"),
6f85d058 252 ],
c3fc2621
CW
253 ],
254 'description' => [
e501603b
TO
255 'name' => 'description',
256 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 257 'title' => ts('Membership Type Description'),
215b423e 258 'description' => ts('Description of Membership Type'),
e501603b
TO
259 'maxlength' => 255,
260 'size' => CRM_Utils_Type::HUGE,
a36434b9 261 'where' => 'civicrm_membership_type.description',
522a26c9 262 'table_name' => 'civicrm_membership_type',
263 'entity' => 'MembershipType',
264 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 265 'localizable' => 1,
c3fc2621 266 'html' => [
e501603b 267 'type' => 'TextArea',
4361de53 268 'label' => ts("Description"),
c3fc2621
CW
269 ],
270 ],
271 'member_of_contact_id' => [
e501603b
TO
272 'name' => 'member_of_contact_id',
273 'type' => CRM_Utils_Type::T_INT,
c3fc2621 274 'title' => ts('Membership Type Organization'),
215b423e 275 'description' => ts('Owner organization for this membership type. FK to Contact ID'),
c3fc2621 276 'required' => TRUE,
a36434b9 277 'where' => 'civicrm_membership_type.member_of_contact_id',
522a26c9 278 'table_name' => 'civicrm_membership_type',
279 'entity' => 'MembershipType',
280 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 281 'localizable' => 0,
e501603b 282 'FKClassName' => 'CRM_Contact_DAO_Contact',
c3fc2621
CW
283 ],
284 'financial_type_id' => [
e501603b
TO
285 'name' => 'financial_type_id',
286 'type' => CRM_Utils_Type::T_INT,
c3fc2621 287 'title' => ts('Membership Financial Type'),
215b423e 288 'description' => ts('If membership is paid by a contribution - what financial type should be used. FK to civicrm_financial_type.id'),
c3fc2621 289 'required' => TRUE,
a36434b9 290 'where' => 'civicrm_membership_type.financial_type_id',
522a26c9 291 'table_name' => 'civicrm_membership_type',
292 'entity' => 'MembershipType',
293 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 294 'localizable' => 0,
e501603b 295 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
c3fc2621 296 'pseudoconstant' => [
e501603b
TO
297 'table' => 'civicrm_financial_type',
298 'keyColumn' => 'id',
299 'labelColumn' => 'name',
c3fc2621
CW
300 ]
301 ],
302 'minimum_fee' => [
e501603b
TO
303 'name' => 'minimum_fee',
304 'type' => CRM_Utils_Type::T_MONEY,
6f85d058 305 'title' => ts('Membership Type Minimum Fee'),
215b423e 306 'description' => ts('Minimum fee for this membership (0 for free/complimentary memberships).'),
c3fc2621 307 'precision' => [
25e0f950
MW
308 18,
309 9
c3fc2621 310 ],
a36434b9 311 'where' => 'civicrm_membership_type.minimum_fee',
45a83e42 312 'default' => '0',
522a26c9 313 'table_name' => 'civicrm_membership_type',
314 'entity' => 'MembershipType',
315 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 316 'localizable' => 0,
6f85d058 317 'html' => [
318 'type' => 'Text',
4361de53 319 'label' => ts("Minimum Fee"),
6f85d058 320 ],
c3fc2621
CW
321 ],
322 'duration_unit' => [
e501603b
TO
323 'name' => 'duration_unit',
324 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 325 'title' => ts('Membership Type Duration Unit'),
215b423e 326 'description' => ts('Unit in which membership period is expressed.'),
e501603b
TO
327 'maxlength' => 8,
328 'size' => CRM_Utils_Type::EIGHT,
a36434b9 329 'where' => 'civicrm_membership_type.duration_unit',
522a26c9 330 'table_name' => 'civicrm_membership_type',
331 'entity' => 'MembershipType',
332 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 333 'localizable' => 0,
c3fc2621 334 'html' => [
e501603b 335 'type' => 'Select',
c3fc2621
CW
336 ],
337 'pseudoconstant' => [
e501603b 338 'callback' => 'CRM_Core_SelectValues::membershipTypeUnitList',
c3fc2621
CW
339 ]
340 ],
341 'duration_interval' => [
e501603b
TO
342 'name' => 'duration_interval',
343 'type' => CRM_Utils_Type::T_INT,
c3fc2621 344 'title' => ts('Membership Type Duration Interval'),
215b423e 345 'description' => ts('Number of duration units in membership period (e.g. 1 year, 12 months).'),
a36434b9 346 'where' => 'civicrm_membership_type.duration_interval',
522a26c9 347 'table_name' => 'civicrm_membership_type',
348 'entity' => 'MembershipType',
349 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 350 'localizable' => 0,
6f85d058 351 'html' => [
352 'type' => 'Text',
353 ],
c3fc2621
CW
354 ],
355 'period_type' => [
e501603b
TO
356 'name' => 'period_type',
357 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 358 'title' => ts('Membership Type Plan'),
215b423e 359 'description' => ts('Rolling membership period starts on signup date. Fixed membership periods start on fixed_period_start_day.'),
e501603b
TO
360 'maxlength' => 8,
361 'size' => CRM_Utils_Type::EIGHT,
a36434b9 362 'where' => 'civicrm_membership_type.period_type',
522a26c9 363 'table_name' => 'civicrm_membership_type',
364 'entity' => 'MembershipType',
365 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 366 'localizable' => 0,
6f85d058 367 'html' => [
368 'type' => 'Select',
369 ],
c3fc2621 370 'pseudoconstant' => [
e501603b 371 'callback' => 'CRM_Core_SelectValues::periodType',
c3fc2621
CW
372 ]
373 ],
374 'fixed_period_start_day' => [
e501603b
TO
375 'name' => 'fixed_period_start_day',
376 'type' => CRM_Utils_Type::T_INT,
c3fc2621 377 'title' => ts('Fixed Period Start Day'),
215b423e 378 'description' => ts('For fixed period memberships, month and day (mmdd) on which subscription/membership will start. Period start is back-dated unless after rollover day.'),
a36434b9 379 'where' => 'civicrm_membership_type.fixed_period_start_day',
522a26c9 380 'table_name' => 'civicrm_membership_type',
381 'entity' => 'MembershipType',
382 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 383 'localizable' => 0,
c3fc2621
CW
384 ],
385 'fixed_period_rollover_day' => [
e501603b
TO
386 'name' => 'fixed_period_rollover_day',
387 'type' => CRM_Utils_Type::T_INT,
c3fc2621 388 'title' => ts('Fixed Period Rollover Day'),
215b423e 389 'description' => ts('For fixed period memberships, signups after this day (mmdd) rollover to next period.'),
a36434b9 390 'where' => 'civicrm_membership_type.fixed_period_rollover_day',
522a26c9 391 'table_name' => 'civicrm_membership_type',
392 'entity' => 'MembershipType',
393 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 394 'localizable' => 0,
c3fc2621
CW
395 ],
396 'relationship_type_id' => [
e501603b
TO
397 'name' => 'relationship_type_id',
398 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 399 'title' => ts('Membership Type Relationship'),
215b423e 400 'description' => ts('FK to Relationship Type ID'),
e501603b
TO
401 'maxlength' => 64,
402 'size' => CRM_Utils_Type::BIG,
a36434b9 403 'where' => 'civicrm_membership_type.relationship_type_id',
522a26c9 404 'table_name' => 'civicrm_membership_type',
405 'entity' => 'MembershipType',
406 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 407 'localizable' => 0,
c3fc2621
CW
408 ],
409 'relationship_direction' => [
e501603b
TO
410 'name' => 'relationship_direction',
411 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 412 'title' => ts('Relationship Direction'),
e501603b
TO
413 'maxlength' => 128,
414 'size' => CRM_Utils_Type::HUGE,
a36434b9 415 'where' => 'civicrm_membership_type.relationship_direction',
522a26c9 416 'table_name' => 'civicrm_membership_type',
417 'entity' => 'MembershipType',
418 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 419 'localizable' => 0,
c3fc2621
CW
420 ],
421 'max_related' => [
e501603b
TO
422 'name' => 'max_related',
423 'type' => CRM_Utils_Type::T_INT,
c3fc2621 424 'title' => ts('Max Related Members for Type'),
215b423e 425 'description' => ts('Maximum number of related memberships.'),
a36434b9 426 'where' => 'civicrm_membership_type.max_related',
522a26c9 427 'table_name' => 'civicrm_membership_type',
428 'entity' => 'MembershipType',
429 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 430 'localizable' => 0,
6f85d058 431 'html' => [
432 'type' => 'Text',
4361de53 433 'label' => ts("Max Related"),
6f85d058 434 ],
c3fc2621
CW
435 ],
436 'visibility' => [
e501603b
TO
437 'name' => 'visibility',
438 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 439 'title' => ts('Visible'),
e501603b
TO
440 'maxlength' => 64,
441 'size' => CRM_Utils_Type::BIG,
a36434b9 442 'where' => 'civicrm_membership_type.visibility',
522a26c9 443 'table_name' => 'civicrm_membership_type',
444 'entity' => 'MembershipType',
445 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 446 'localizable' => 0,
c3fc2621 447 'html' => [
e501603b 448 'type' => 'Select',
c3fc2621
CW
449 ],
450 'pseudoconstant' => [
e501603b 451 'callback' => 'CRM_Core_SelectValues::memberVisibility',
c3fc2621
CW
452 ]
453 ],
454 'weight' => [
e501603b
TO
455 'name' => 'weight',
456 'type' => CRM_Utils_Type::T_INT,
c3fc2621 457 'title' => ts('Order'),
a36434b9 458 'where' => 'civicrm_membership_type.weight',
522a26c9 459 'table_name' => 'civicrm_membership_type',
460 'entity' => 'MembershipType',
461 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 462 'localizable' => 0,
6f85d058 463 'html' => [
464 'type' => 'Text',
465 ],
c3fc2621
CW
466 ],
467 'receipt_text_signup' => [
e501603b
TO
468 'name' => 'receipt_text_signup',
469 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 470 'title' => ts('Membership Type Receipt Text'),
215b423e 471 'description' => ts('Receipt Text for membership signup'),
e501603b
TO
472 'maxlength' => 255,
473 'size' => CRM_Utils_Type::HUGE,
a36434b9 474 'where' => 'civicrm_membership_type.receipt_text_signup',
522a26c9 475 'table_name' => 'civicrm_membership_type',
476 'entity' => 'MembershipType',
477 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 478 'localizable' => 0,
c3fc2621 479 'html' => [
e501603b 480 'type' => 'TextArea',
c3fc2621
CW
481 ],
482 ],
483 'receipt_text_renewal' => [
e501603b
TO
484 'name' => 'receipt_text_renewal',
485 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 486 'title' => ts('Membership Type Renewal Text'),
215b423e 487 'description' => ts('Receipt Text for membership renewal'),
e501603b
TO
488 'maxlength' => 255,
489 'size' => CRM_Utils_Type::HUGE,
a36434b9 490 'where' => 'civicrm_membership_type.receipt_text_renewal',
522a26c9 491 'table_name' => 'civicrm_membership_type',
492 'entity' => 'MembershipType',
493 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 494 'localizable' => 0,
c3fc2621 495 'html' => [
e501603b 496 'type' => 'TextArea',
c3fc2621
CW
497 ],
498 ],
499 'auto_renew' => [
e501603b
TO
500 'name' => 'auto_renew',
501 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 502 'title' => ts('Auto Renew'),
215b423e 503 'description' => ts('0 = No auto-renew option; 1 = Give option, but not required; 2 = Auto-renew required;'),
a36434b9 504 'where' => 'civicrm_membership_type.auto_renew',
45a83e42 505 'default' => '0',
522a26c9 506 'table_name' => 'civicrm_membership_type',
507 'entity' => 'MembershipType',
508 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 509 'localizable' => 0,
fc093e40 510 'html' => [
511 'type' => 'Radio',
512 ],
c3fc2621 513 'pseudoconstant' => [
e501603b 514 'callback' => 'CRM_Core_SelectValues::memberAutoRenew',
c3fc2621
CW
515 ]
516 ],
517 'is_active' => [
e501603b
TO
518 'name' => 'is_active',
519 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 520 'title' => ts('Is Active'),
215b423e 521 'description' => ts('Is this membership_type enabled'),
a36434b9 522 'where' => 'civicrm_membership_type.is_active',
e501603b 523 'default' => '1',
522a26c9 524 'table_name' => 'civicrm_membership_type',
525 'entity' => 'MembershipType',
526 'bao' => 'CRM_Member_BAO_MembershipType',
6a7e5e5d 527 'localizable' => 0,
6f85d058 528 'html' => [
529 'type' => 'CheckBox',
4361de53 530 'label' => ts("Enabled?"),
6f85d058 531 ],
c3fc2621
CW
532 ],
533 ];
346aaaba 534 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 535 }
346aaaba 536 return Civi::$statics[__CLASS__]['fields'];
e501603b 537 }
c3fc2621 538
e501603b 539 /**
bd8e0b14 540 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
541 *
542 * @return array
bd8e0b14 543 * Array(string $name => string $uniqueName).
e501603b 544 */
c3fc2621 545 public static function &fieldKeys() {
bd8e0b14
TO
546 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
547 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 548 }
bd8e0b14 549 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 550 }
c3fc2621 551
e501603b
TO
552 /**
553 * Returns the names of this table
554 *
555 * @return string
556 */
c3fc2621 557 public static function getTableName() {
e501603b
TO
558 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
559 }
c3fc2621 560
e501603b
TO
561 /**
562 * Returns if this table needs to be logged
563 *
c3fc2621 564 * @return bool
e501603b 565 */
c3fc2621 566 public function getLog() {
e501603b
TO
567 return self::$_log;
568 }
c3fc2621 569
e501603b
TO
570 /**
571 * Returns the list of fields that can be imported
572 *
573 * @param bool $prefix
574 *
575 * @return array
576 */
c3fc2621
CW
577 public static function &import($prefix = FALSE) {
578 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_type', $prefix, []);
60808919 579 return $r;
e501603b 580 }
c3fc2621 581
e501603b
TO
582 /**
583 * Returns the list of fields that can be exported
584 *
585 * @param bool $prefix
586 *
587 * @return array
588 */
c3fc2621
CW
589 public static function &export($prefix = FALSE) {
590 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_type', $prefix, []);
60808919 591 return $r;
e501603b 592 }
c3fc2621 593
e7a6b91a
AS
594 /**
595 * Returns the list of indices
c3fc2621
CW
596 *
597 * @param bool $localize
598 *
599 * @return array
e7a6b91a
AS
600 */
601 public static function indices($localize = TRUE) {
c3fc2621
CW
602 $indices = [
603 'index_relationship_type_id' => [
e7a6b91a 604 'name' => 'index_relationship_type_id',
c3fc2621 605 'field' => [
e7a6b91a 606 0 => 'relationship_type_id',
c3fc2621
CW
607 ],
608 'localizable' => FALSE,
e7a6b91a 609 'sig' => 'civicrm_membership_type::0::relationship_type_id',
c3fc2621
CW
610 ],
611 ];
e7a6b91a
AS
612 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
613 }
c3fc2621 614
e501603b 615}