Merge pull request #13241 from seamuslee001/561_schedule_reminders
[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
e380ee3b 9 * (GenCodeChecksum:08e72cd783856c58dbdaeee364102c01)
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 */
22 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 */
c3fc2621
CW
29 static $_log = FALSE;
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,
522a26c9 67 'table_name' => 'civicrm_address_format',
68 'entity' => 'AddressFormat',
69 'bao' => 'CRM_Core_DAO_AddressFormat',
6a7e5e5d 70 'localizable' => 0,
c3fc2621
CW
71 ],
72 'format' => [
e501603b
TO
73 'name' => 'format',
74 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 75 'title' => ts('Address Format'),
215b423e 76 'description' => ts('The format of an address'),
522a26c9 77 'table_name' => 'civicrm_address_format',
78 'entity' => 'AddressFormat',
79 'bao' => 'CRM_Core_DAO_AddressFormat',
6a7e5e5d 80 'localizable' => 0,
c3fc2621
CW
81 ],
82 ];
346aaaba 83 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 84 }
346aaaba 85 return Civi::$statics[__CLASS__]['fields'];
e501603b 86 }
c3fc2621 87
e501603b 88 /**
bd8e0b14 89 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
90 *
91 * @return array
bd8e0b14 92 * Array(string $name => string $uniqueName).
e501603b 93 */
c3fc2621 94 public static function &fieldKeys() {
bd8e0b14
TO
95 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
96 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 97 }
bd8e0b14 98 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 99 }
c3fc2621 100
e501603b
TO
101 /**
102 * Returns the names of this table
103 *
104 * @return string
105 */
c3fc2621 106 public static function getTableName() {
e501603b
TO
107 return self::$_tableName;
108 }
c3fc2621 109
e501603b
TO
110 /**
111 * Returns if this table needs to be logged
112 *
c3fc2621 113 * @return bool
e501603b 114 */
c3fc2621 115 public function getLog() {
e501603b
TO
116 return self::$_log;
117 }
c3fc2621 118
e501603b
TO
119 /**
120 * Returns the list of fields that can be imported
121 *
122 * @param bool $prefix
123 *
124 * @return array
125 */
c3fc2621
CW
126 public static function &import($prefix = FALSE) {
127 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'address_format', $prefix, []);
60808919 128 return $r;
e501603b 129 }
c3fc2621 130
e501603b
TO
131 /**
132 * Returns the list of fields that can be exported
133 *
134 * @param bool $prefix
135 *
136 * @return array
137 */
c3fc2621
CW
138 public static function &export($prefix = FALSE) {
139 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'address_format', $prefix, []);
60808919 140 return $r;
e501603b 141 }
c3fc2621 142
e7a6b91a
AS
143 /**
144 * Returns the list of indices
c3fc2621
CW
145 *
146 * @param bool $localize
147 *
148 * @return array
e7a6b91a
AS
149 */
150 public static function indices($localize = TRUE) {
c3fc2621 151 $indices = [];
e7a6b91a
AS
152 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
153 }
c3fc2621 154
e501603b 155}