Merge pull request #14276 from eileenmcnaughton/dbunit_2
[civicrm-core.git] / CRM / Core / DAO / AddressFormat.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/Core/AddressFormat.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
042043f1 9 * (GenCodeChecksum:5565fabb08fe3bd77aa487ed94a2adad)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the AddressFormat entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_AddressFormat 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_address_format';
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 = FALSE;
c3fc2621 30
e501603b
TO
31 /**
32 * Address Format Id
33 *
34 * @var int unsigned
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * The format of an address
40 *
41 * @var text
42 */
43 public $format;
c3fc2621 44
e501603b 45 /**
f41f0342 46 * Class constructor.
e501603b 47 */
c3fc2621 48 public function __construct() {
e501603b
TO
49 $this->__table = 'civicrm_address_format';
50 parent::__construct();
51 }
c3fc2621 52
e501603b
TO
53 /**
54 * Returns all the column names of this table
55 *
56 * @return array
57 */
c3fc2621 58 public static function &fields() {
346aaaba 59 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
60 Civi::$statics[__CLASS__]['fields'] = [
61 'id' => [
e501603b
TO
62 'name' => 'id',
63 'type' => CRM_Utils_Type::T_INT,
c3fc2621 64 'title' => ts('Address Format ID'),
215b423e 65 'description' => ts('Address Format Id'),
c3fc2621 66 'required' => TRUE,
a36434b9 67 'where' => 'civicrm_address_format.id',
522a26c9 68 'table_name' => 'civicrm_address_format',
69 'entity' => 'AddressFormat',
70 'bao' => 'CRM_Core_DAO_AddressFormat',
6a7e5e5d 71 'localizable' => 0,
c3fc2621
CW
72 ],
73 'format' => [
e501603b
TO
74 'name' => 'format',
75 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 76 'title' => ts('Address Format'),
215b423e 77 'description' => ts('The format of an address'),
a36434b9 78 'where' => 'civicrm_address_format.format',
522a26c9 79 'table_name' => 'civicrm_address_format',
80 'entity' => 'AddressFormat',
81 'bao' => 'CRM_Core_DAO_AddressFormat',
6a7e5e5d 82 'localizable' => 0,
c3fc2621
CW
83 ],
84 ];
346aaaba 85 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 86 }
346aaaba 87 return Civi::$statics[__CLASS__]['fields'];
e501603b 88 }
c3fc2621 89
e501603b 90 /**
bd8e0b14 91 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
92 *
93 * @return array
bd8e0b14 94 * Array(string $name => string $uniqueName).
e501603b 95 */
c3fc2621 96 public static function &fieldKeys() {
bd8e0b14
TO
97 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
98 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 99 }
bd8e0b14 100 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 101 }
c3fc2621 102
e501603b
TO
103 /**
104 * Returns the names of this table
105 *
106 * @return string
107 */
c3fc2621 108 public static function getTableName() {
e501603b
TO
109 return self::$_tableName;
110 }
c3fc2621 111
e501603b
TO
112 /**
113 * Returns if this table needs to be logged
114 *
c3fc2621 115 * @return bool
e501603b 116 */
c3fc2621 117 public function getLog() {
e501603b
TO
118 return self::$_log;
119 }
c3fc2621 120
e501603b
TO
121 /**
122 * Returns the list of fields that can be imported
123 *
124 * @param bool $prefix
125 *
126 * @return array
127 */
c3fc2621
CW
128 public static function &import($prefix = FALSE) {
129 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'address_format', $prefix, []);
60808919 130 return $r;
e501603b 131 }
c3fc2621 132
e501603b
TO
133 /**
134 * Returns the list of fields that can be exported
135 *
136 * @param bool $prefix
137 *
138 * @return array
139 */
c3fc2621
CW
140 public static function &export($prefix = FALSE) {
141 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'address_format', $prefix, []);
60808919 142 return $r;
e501603b 143 }
c3fc2621 144
e7a6b91a
AS
145 /**
146 * Returns the list of indices
c3fc2621
CW
147 *
148 * @param bool $localize
149 *
150 * @return array
e7a6b91a
AS
151 */
152 public static function indices($localize = TRUE) {
c3fc2621 153 $indices = [];
e7a6b91a
AS
154 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
155 }
c3fc2621 156
e501603b 157}