5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/AddressFormat.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:1ce11647576d05acfc364969eddfcce4)
13 * Database access object for the AddressFormat entity.
15 class CRM_Core_DAO_AddressFormat
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.2';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_address_format';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * The format of an address
50 public function __construct() {
51 $this->__table
= 'civicrm_address_format';
52 parent
::__construct();
56 * Returns localized title of this entity.
58 public static function getEntityTitle() {
59 return ts('Address Formats');
63 * Returns all the column names of this table
67 public static function &fields() {
68 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
69 Civi
::$statics[__CLASS__
]['fields'] = [
72 'type' => CRM_Utils_Type
::T_INT
,
73 'title' => ts('Address Format ID'),
74 'description' => ts('Address Format Id'),
76 'where' => 'civicrm_address_format.id',
77 'table_name' => 'civicrm_address_format',
78 'entity' => 'AddressFormat',
79 'bao' => 'CRM_Core_DAO_AddressFormat',
85 'type' => CRM_Utils_Type
::T_TEXT
,
86 'title' => ts('Address Format'),
87 'description' => ts('The format of an address'),
88 'where' => 'civicrm_address_format.format',
89 'table_name' => 'civicrm_address_format',
90 'entity' => 'AddressFormat',
91 'bao' => 'CRM_Core_DAO_AddressFormat',
96 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
98 return Civi
::$statics[__CLASS__
]['fields'];
102 * Return a mapping from field-name to the corresponding key (as used in fields()).
105 * Array(string $name => string $uniqueName).
107 public static function &fieldKeys() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
109 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
111 return Civi
::$statics[__CLASS__
]['fieldKeys'];
115 * Returns the names of this table
119 public static function getTableName() {
120 return self
::$_tableName;
124 * Returns if this table needs to be logged
128 public function getLog() {
133 * Returns the list of fields that can be imported
135 * @param bool $prefix
139 public static function &import($prefix = FALSE) {
140 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'address_format', $prefix, []);
145 * Returns the list of fields that can be exported
147 * @param bool $prefix
151 public static function &export($prefix = FALSE) {
152 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'address_format', $prefix, []);
157 * Returns the list of indices
159 * @param bool $localize
163 public static function indices($localize = TRUE) {
165 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;