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:bdb3bcc498465d39e8bd700f5c3b64df)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * The format of an address
47 * Note that values will be retrieved from the database as a string.
54 public function __construct() {
55 $this->__table
= 'civicrm_address_format';
56 parent
::__construct();
60 * Returns localized title of this entity.
63 * Whether to return the plural version of the title.
65 public static function getEntityTitle($plural = FALSE) {
66 return $plural ?
ts('Address Formats') : ts('Address Format');
70 * Returns all the column names of this table
74 public static function &fields() {
75 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
76 Civi
::$statics[__CLASS__
]['fields'] = [
79 'type' => CRM_Utils_Type
::T_INT
,
80 'title' => ts('Address Format ID'),
81 'description' => ts('Address Format ID'),
83 'where' => 'civicrm_address_format.id',
84 'table_name' => 'civicrm_address_format',
85 'entity' => 'AddressFormat',
86 'bao' => 'CRM_Core_DAO_AddressFormat',
96 'type' => CRM_Utils_Type
::T_TEXT
,
97 'title' => ts('Address Format'),
98 'description' => ts('The format of an address'),
99 'where' => 'civicrm_address_format.format',
100 'table_name' => 'civicrm_address_format',
101 'entity' => 'AddressFormat',
102 'bao' => 'CRM_Core_DAO_AddressFormat',
107 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
109 return Civi
::$statics[__CLASS__
]['fields'];
113 * Return a mapping from field-name to the corresponding key (as used in fields()).
116 * Array(string $name => string $uniqueName).
118 public static function &fieldKeys() {
119 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
120 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
122 return Civi
::$statics[__CLASS__
]['fieldKeys'];
126 * Returns the names of this table
130 public static function getTableName() {
131 return self
::$_tableName;
135 * Returns if this table needs to be logged
139 public function getLog() {
144 * Returns the list of fields that can be imported
146 * @param bool $prefix
150 public static function &import($prefix = FALSE) {
151 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'address_format', $prefix, []);
156 * Returns the list of fields that can be exported
158 * @param bool $prefix
162 public static function &export($prefix = FALSE) {
163 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'address_format', $prefix, []);
168 * Returns the list of indices
170 * @param bool $localize
174 public static function indices($localize = TRUE) {
176 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;