5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/AddressFormat.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:08e72cd783856c58dbdaeee364102c01)
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 static $_tableName = 'civicrm_address_format';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_address_format',
68 'entity' => 'AddressFormat',
69 'bao' => 'CRM_Core_DAO_AddressFormat',
74 'type' => CRM_Utils_Type
::T_TEXT
,
75 'title' => ts('Address Format'),
76 'description' => ts('The format of an address'),
77 'table_name' => 'civicrm_address_format',
78 'entity' => 'AddressFormat',
79 'bao' => 'CRM_Core_DAO_AddressFormat',
83 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
85 return Civi
::$statics[__CLASS__
]['fields'];
89 * Return a mapping from field-name to the corresponding key (as used in fields()).
92 * Array(string $name => string $uniqueName).
94 public static function &fieldKeys() {
95 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
96 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
98 return Civi
::$statics[__CLASS__
]['fieldKeys'];
102 * Returns the names of this table
106 public static function getTableName() {
107 return self
::$_tableName;
111 * Returns if this table needs to be logged
115 public function getLog() {
120 * Returns the list of fields that can be imported
122 * @param bool $prefix
126 public static function &import($prefix = FALSE) {
127 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'address_format', $prefix, []);
132 * Returns the list of fields that can be exported
134 * @param bool $prefix
138 public static function &export($prefix = FALSE) {
139 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'address_format', $prefix, []);
144 * Returns the list of indices
146 * @param bool $localize
150 public static function indices($localize = TRUE) {
152 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;