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 | |
33 | * (GenCodeChecksum:ab9f0a517aa2c23031b0a3e53c4e6daa) | |
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; | |
50 | /** | |
51 | * static instance to hold the keys used in $_fields for each field. | |
52 | * | |
53 | * @var array | |
54 | */ | |
55 | static $_fieldKeys = null; | |
56 | /** | |
57 | * static instance to hold the FK relationships | |
58 | * | |
59 | * @var string | |
60 | */ | |
61 | static $_links = null; | |
62 | /** | |
63 | * static instance to hold the values that can | |
64 | * be imported | |
65 | * | |
66 | * @var array | |
67 | */ | |
68 | static $_import = null; | |
69 | /** | |
70 | * static instance to hold the values that can | |
71 | * be exported | |
72 | * | |
73 | * @var array | |
74 | */ | |
75 | static $_export = null; | |
76 | /** | |
77 | * static value to see if we should log any modifications to | |
78 | * this table in the civicrm_log table | |
79 | * | |
80 | * @var boolean | |
81 | */ | |
82 | static $_log = false; | |
83 | /** | |
84 | * Address Format Id | |
85 | * | |
86 | * @var int unsigned | |
87 | */ | |
88 | public $id; | |
89 | /** | |
90 | * The format of an address | |
91 | * | |
92 | * @var text | |
93 | */ | |
94 | public $format; | |
95 | /** | |
96 | * class constructor | |
97 | * | |
98 | * @return civicrm_address_format | |
99 | */ | |
100 | function __construct() { | |
101 | $this->__table = 'civicrm_address_format'; | |
102 | parent::__construct(); | |
103 | } | |
104 | /** | |
105 | * Returns all the column names of this table | |
106 | * | |
107 | * @return array | |
108 | */ | |
109 | static function &fields() { | |
110 | if (!(self::$_fields)) { | |
111 | self::$_fields = array( | |
112 | 'id' => array( | |
113 | 'name' => 'id', | |
114 | 'type' => CRM_Utils_Type::T_INT, | |
115 | 'title' => ts('Address Format ID') , | |
116 | 'description' => 'Address Format Id', | |
117 | 'required' => true, | |
118 | ) , | |
119 | 'format' => array( | |
120 | 'name' => 'format', | |
121 | 'type' => CRM_Utils_Type::T_TEXT, | |
122 | 'title' => ts('Address Format') , | |
123 | 'description' => 'The format of an address', | |
124 | ) , | |
125 | ); | |
126 | } | |
127 | return self::$_fields; | |
128 | } | |
129 | /** | |
130 | * Returns an array containing, for each field, the arary key used for that | |
131 | * field in self::$_fields. | |
132 | * | |
133 | * @return array | |
134 | */ | |
135 | static function &fieldKeys() { | |
136 | if (!(self::$_fieldKeys)) { | |
137 | self::$_fieldKeys = array( | |
138 | 'id' => 'id', | |
139 | 'format' => 'format', | |
140 | ); | |
141 | } | |
142 | return self::$_fieldKeys; | |
143 | } | |
144 | /** | |
145 | * Returns the names of this table | |
146 | * | |
147 | * @return string | |
148 | */ | |
149 | static function getTableName() { | |
150 | return self::$_tableName; | |
151 | } | |
152 | /** | |
153 | * Returns if this table needs to be logged | |
154 | * | |
155 | * @return boolean | |
156 | */ | |
157 | function getLog() { | |
158 | return self::$_log; | |
159 | } | |
160 | /** | |
161 | * Returns the list of fields that can be imported | |
162 | * | |
163 | * @param bool $prefix | |
164 | * | |
165 | * @return array | |
166 | */ | |
167 | static function &import($prefix = false) { | |
168 | if (!(self::$_import)) { | |
169 | self::$_import = array(); | |
170 | $fields = self::fields(); | |
171 | foreach($fields as $name => $field) { | |
172 | if (CRM_Utils_Array::value('import', $field)) { | |
173 | if ($prefix) { | |
174 | self::$_import['address_format'] = & $fields[$name]; | |
175 | } else { | |
176 | self::$_import[$name] = & $fields[$name]; | |
177 | } | |
178 | } | |
179 | } | |
180 | } | |
181 | return self::$_import; | |
182 | } | |
183 | /** | |
184 | * Returns the list of fields that can be exported | |
185 | * | |
186 | * @param bool $prefix | |
187 | * | |
188 | * @return array | |
189 | */ | |
190 | static function &export($prefix = false) { | |
191 | if (!(self::$_export)) { | |
192 | self::$_export = array(); | |
193 | $fields = self::fields(); | |
194 | foreach($fields as $name => $field) { | |
195 | if (CRM_Utils_Array::value('export', $field)) { | |
196 | if ($prefix) { | |
197 | self::$_export['address_format'] = & $fields[$name]; | |
198 | } else { | |
199 | self::$_export[$name] = & $fields[$name]; | |
200 | } | |
201 | } | |
202 | } | |
203 | } | |
204 | return self::$_export; | |
205 | } | |
206 | } |