Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2016 | | |
7 | +--------------------------------------------------------------------+ | |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | /** | |
28 | * @package CRM | |
29 | * @copyright CiviCRM LLC (c) 2004-2016 | |
30 | * | |
31 | * Generated from xml/schema/CRM/Core/AddressFormat.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:ef2bb5732dc5f40f6713f48c72f011ba) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Core_DAO_AddressFormat extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_address_format'; | |
44 | /** | |
45 | * static instance to hold the field values | |
46 | * | |
47 | * @var array | |
48 | */ | |
49 | static $_fields = null; | |
e501603b TO |
50 | /** |
51 | * static instance to hold the FK relationships | |
52 | * | |
53 | * @var string | |
54 | */ | |
55 | static $_links = null; | |
e501603b TO |
56 | /** |
57 | * static value to see if we should log any modifications to | |
58 | * this table in the civicrm_log table | |
59 | * | |
60 | * @var boolean | |
61 | */ | |
62 | static $_log = false; | |
63 | /** | |
64 | * Address Format Id | |
65 | * | |
66 | * @var int unsigned | |
67 | */ | |
68 | public $id; | |
69 | /** | |
70 | * The format of an address | |
71 | * | |
72 | * @var text | |
73 | */ | |
74 | public $format; | |
75 | /** | |
76 | * class constructor | |
77 | * | |
78 | * @return civicrm_address_format | |
79 | */ | |
80 | function __construct() { | |
81 | $this->__table = 'civicrm_address_format'; | |
82 | parent::__construct(); | |
83 | } | |
84 | /** | |
85 | * Returns all the column names of this table | |
86 | * | |
87 | * @return array | |
88 | */ | |
89 | static function &fields() { | |
90 | if (!(self::$_fields)) { | |
91 | self::$_fields = array( | |
92 | 'id' => array( | |
93 | 'name' => 'id', | |
94 | 'type' => CRM_Utils_Type::T_INT, | |
95 | 'title' => ts('Address Format ID') , | |
96 | 'description' => 'Address Format Id', | |
97 | 'required' => true, | |
98 | ) , | |
99 | 'format' => array( | |
100 | 'name' => 'format', | |
101 | 'type' => CRM_Utils_Type::T_TEXT, | |
102 | 'title' => ts('Address Format') , | |
103 | 'description' => 'The format of an address', | |
104 | ) , | |
105 | ); | |
106 | } | |
107 | return self::$_fields; | |
108 | } | |
109 | /** | |
bd8e0b14 | 110 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
111 | * |
112 | * @return array | |
bd8e0b14 | 113 | * Array(string $name => string $uniqueName). |
e501603b TO |
114 | */ |
115 | static function &fieldKeys() { | |
bd8e0b14 TO |
116 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
117 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 118 | } |
bd8e0b14 | 119 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
120 | } |
121 | /** | |
122 | * Returns the names of this table | |
123 | * | |
124 | * @return string | |
125 | */ | |
126 | static function getTableName() { | |
127 | return self::$_tableName; | |
128 | } | |
129 | /** | |
130 | * Returns if this table needs to be logged | |
131 | * | |
132 | * @return boolean | |
133 | */ | |
134 | function getLog() { | |
135 | return self::$_log; | |
136 | } | |
137 | /** | |
138 | * Returns the list of fields that can be imported | |
139 | * | |
140 | * @param bool $prefix | |
141 | * | |
142 | * @return array | |
143 | */ | |
144 | static function &import($prefix = false) { | |
60808919 TO |
145 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'address_format', $prefix, array()); |
146 | return $r; | |
e501603b TO |
147 | } |
148 | /** | |
149 | * Returns the list of fields that can be exported | |
150 | * | |
151 | * @param bool $prefix | |
152 | * | |
153 | * @return array | |
154 | */ | |
155 | static function &export($prefix = false) { | |
60808919 TO |
156 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'address_format', $prefix, array()); |
157 | return $r; | |
e501603b TO |
158 | } |
159 | } |