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:fc7e6c978b71e38b5357cee46708a649)
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.
59 * Whether to return the plural version of the title.
61 public static function getEntityTitle($plural = FALSE) {
62 return $plural ?
ts('Address Formats') : ts('Address Format');
66 * Returns all the column names of this table
70 public static function &fields() {
71 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
72 Civi
::$statics[__CLASS__
]['fields'] = [
75 'type' => CRM_Utils_Type
::T_INT
,
76 'title' => ts('Address Format ID'),
77 'description' => ts('Address Format ID'),
79 'where' => 'civicrm_address_format.id',
80 'table_name' => 'civicrm_address_format',
81 'entity' => 'AddressFormat',
82 'bao' => 'CRM_Core_DAO_AddressFormat',
92 'type' => CRM_Utils_Type
::T_TEXT
,
93 'title' => ts('Address Format'),
94 'description' => ts('The format of an address'),
95 'where' => 'civicrm_address_format.format',
96 'table_name' => 'civicrm_address_format',
97 'entity' => 'AddressFormat',
98 'bao' => 'CRM_Core_DAO_AddressFormat',
103 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
105 return Civi
::$statics[__CLASS__
]['fields'];
109 * Return a mapping from field-name to the corresponding key (as used in fields()).
112 * Array(string $name => string $uniqueName).
114 public static function &fieldKeys() {
115 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
116 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
118 return Civi
::$statics[__CLASS__
]['fieldKeys'];
122 * Returns the names of this table
126 public static function getTableName() {
127 return self
::$_tableName;
131 * Returns if this table needs to be logged
135 public function getLog() {
140 * Returns the list of fields that can be imported
142 * @param bool $prefix
146 public static function &import($prefix = FALSE) {
147 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'address_format', $prefix, []);
152 * Returns the list of fields that can be exported
154 * @param bool $prefix
158 public static function &export($prefix = FALSE) {
159 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'address_format', $prefix, []);
164 * Returns the list of indices
166 * @param bool $localize
170 public static function indices($localize = TRUE) {
172 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;