5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/AddressFormat.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:144542b9aa31391600f73d885f819091)
13 * Database access object for the AddressFormat entity.
15 class CRM_Core_DAO_AddressFormat
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_address_format';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * The format of an address
48 public function __construct() {
49 $this->__table
= 'civicrm_address_format';
50 parent
::__construct();
54 * Returns all the column names of this table
58 public static function &fields() {
59 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
60 Civi
::$statics[__CLASS__
]['fields'] = [
63 'type' => CRM_Utils_Type
::T_INT
,
64 'title' => ts('Address Format ID'),
65 'description' => ts('Address Format Id'),
67 'where' => 'civicrm_address_format.id',
68 'table_name' => 'civicrm_address_format',
69 'entity' => 'AddressFormat',
70 'bao' => 'CRM_Core_DAO_AddressFormat',
75 'type' => CRM_Utils_Type
::T_TEXT
,
76 'title' => ts('Address Format'),
77 'description' => ts('The format of an address'),
78 'where' => 'civicrm_address_format.format',
79 'table_name' => 'civicrm_address_format',
80 'entity' => 'AddressFormat',
81 'bao' => 'CRM_Core_DAO_AddressFormat',
85 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
87 return Civi
::$statics[__CLASS__
]['fields'];
91 * Return a mapping from field-name to the corresponding key (as used in fields()).
94 * Array(string $name => string $uniqueName).
96 public static function &fieldKeys() {
97 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
98 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
100 return Civi
::$statics[__CLASS__
]['fieldKeys'];
104 * Returns the names of this table
108 public static function getTableName() {
109 return self
::$_tableName;
113 * Returns if this table needs to be logged
117 public function getLog() {
122 * Returns the list of fields that can be imported
124 * @param bool $prefix
128 public static function &import($prefix = FALSE) {
129 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'address_format', $prefix, []);
134 * Returns the list of fields that can be exported
136 * @param bool $prefix
140 public static function &export($prefix = FALSE) {
141 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'address_format', $prefix, []);
146 * Returns the list of indices
148 * @param bool $localize
152 public static function indices($localize = TRUE) {
154 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;