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/Mailing/Event/Subscribe.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:2f33a8fdacd5e6e0a8858e73a536f3fc) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Mailing_Event_DAO_Subscribe extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_mailing_event_subscribe'; | |
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 | * | |
85 | * @var int unsigned | |
86 | */ | |
87 | public $id; | |
88 | /** | |
89 | * FK to Group | |
90 | * | |
91 | * @var int unsigned | |
92 | */ | |
93 | public $group_id; | |
94 | /** | |
95 | * FK to Contact | |
96 | * | |
97 | * @var int unsigned | |
98 | */ | |
99 | public $contact_id; | |
100 | /** | |
101 | * Security hash | |
102 | * | |
103 | * @var string | |
104 | */ | |
105 | public $hash; | |
106 | /** | |
107 | * When this subscription event occurred. | |
108 | * | |
109 | * @var datetime | |
110 | */ | |
111 | public $time_stamp; | |
112 | /** | |
113 | * class constructor | |
114 | * | |
115 | * @return civicrm_mailing_event_subscribe | |
116 | */ | |
117 | function __construct() { | |
118 | $this->__table = 'civicrm_mailing_event_subscribe'; | |
119 | parent::__construct(); | |
120 | } | |
121 | /** | |
122 | * Returns foreign keys and entity references | |
123 | * | |
124 | * @return array | |
125 | * [CRM_Core_Reference_Interface] | |
126 | */ | |
127 | static function getReferenceColumns() { | |
128 | if (!self::$_links) { | |
129 | self::$_links = static ::createReferenceColumns(__CLASS__); | |
130 | self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id'); | |
131 | self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); | |
132 | } | |
133 | return self::$_links; | |
134 | } | |
135 | /** | |
136 | * Returns all the column names of this table | |
137 | * | |
138 | * @return array | |
139 | */ | |
140 | static function &fields() { | |
141 | if (!(self::$_fields)) { | |
142 | self::$_fields = array( | |
143 | 'id' => array( | |
144 | 'name' => 'id', | |
145 | 'type' => CRM_Utils_Type::T_INT, | |
146 | 'title' => ts('Mailing Subscribe ID') , | |
147 | 'required' => true, | |
148 | ) , | |
149 | 'group_id' => array( | |
150 | 'name' => 'group_id', | |
151 | 'type' => CRM_Utils_Type::T_INT, | |
152 | 'title' => ts('Mailing Subscribe Group') , | |
153 | 'description' => 'FK to Group', | |
154 | 'required' => true, | |
155 | 'FKClassName' => 'CRM_Contact_DAO_Group', | |
156 | 'html' => array( | |
157 | 'type' => 'Select', | |
158 | ) , | |
159 | 'pseudoconstant' => array( | |
160 | 'table' => 'civicrm_group', | |
161 | 'keyColumn' => 'id', | |
162 | 'labelColumn' => 'title', | |
163 | ) | |
164 | ) , | |
165 | 'contact_id' => array( | |
166 | 'name' => 'contact_id', | |
167 | 'type' => CRM_Utils_Type::T_INT, | |
168 | 'title' => ts('Mailing Subscribe Contact') , | |
169 | 'description' => 'FK to Contact', | |
170 | 'required' => true, | |
171 | 'FKClassName' => 'CRM_Contact_DAO_Contact', | |
172 | ) , | |
173 | 'hash' => array( | |
174 | 'name' => 'hash', | |
175 | 'type' => CRM_Utils_Type::T_STRING, | |
176 | 'title' => ts('Mailing Subscribe Hash') , | |
177 | 'description' => 'Security hash', | |
178 | 'required' => true, | |
179 | 'maxlength' => 255, | |
180 | 'size' => CRM_Utils_Type::HUGE, | |
181 | ) , | |
182 | 'time_stamp' => array( | |
183 | 'name' => 'time_stamp', | |
184 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
185 | 'title' => ts('Mailing Subscribe Timestamp') , | |
186 | 'description' => 'When this subscription event occurred.', | |
187 | 'required' => true, | |
188 | ) , | |
189 | ); | |
190 | } | |
191 | return self::$_fields; | |
192 | } | |
193 | /** | |
194 | * Returns an array containing, for each field, the arary key used for that | |
195 | * field in self::$_fields. | |
196 | * | |
197 | * @return array | |
198 | */ | |
199 | static function &fieldKeys() { | |
200 | if (!(self::$_fieldKeys)) { | |
201 | self::$_fieldKeys = array( | |
202 | 'id' => 'id', | |
203 | 'group_id' => 'group_id', | |
204 | 'contact_id' => 'contact_id', | |
205 | 'hash' => 'hash', | |
206 | 'time_stamp' => 'time_stamp', | |
207 | ); | |
208 | } | |
209 | return self::$_fieldKeys; | |
210 | } | |
211 | /** | |
212 | * Returns the names of this table | |
213 | * | |
214 | * @return string | |
215 | */ | |
216 | static function getTableName() { | |
217 | return self::$_tableName; | |
218 | } | |
219 | /** | |
220 | * Returns if this table needs to be logged | |
221 | * | |
222 | * @return boolean | |
223 | */ | |
224 | function getLog() { | |
225 | return self::$_log; | |
226 | } | |
227 | /** | |
228 | * Returns the list of fields that can be imported | |
229 | * | |
230 | * @param bool $prefix | |
231 | * | |
232 | * @return array | |
233 | */ | |
234 | static function &import($prefix = false) { | |
235 | if (!(self::$_import)) { | |
236 | self::$_import = array(); | |
237 | $fields = self::fields(); | |
238 | foreach($fields as $name => $field) { | |
239 | if (CRM_Utils_Array::value('import', $field)) { | |
240 | if ($prefix) { | |
241 | self::$_import['mailing_event_subscribe'] = & $fields[$name]; | |
242 | } else { | |
243 | self::$_import[$name] = & $fields[$name]; | |
244 | } | |
245 | } | |
246 | } | |
247 | } | |
248 | return self::$_import; | |
249 | } | |
250 | /** | |
251 | * Returns the list of fields that can be exported | |
252 | * | |
253 | * @param bool $prefix | |
254 | * | |
255 | * @return array | |
256 | */ | |
257 | static function &export($prefix = false) { | |
258 | if (!(self::$_export)) { | |
259 | self::$_export = array(); | |
260 | $fields = self::fields(); | |
261 | foreach($fields as $name => $field) { | |
262 | if (CRM_Utils_Array::value('export', $field)) { | |
263 | if ($prefix) { | |
264 | self::$_export['mailing_event_subscribe'] = & $fields[$name]; | |
265 | } else { | |
266 | self::$_export[$name] = & $fields[$name]; | |
267 | } | |
268 | } | |
269 | } | |
270 | } | |
271 | return self::$_export; | |
272 | } | |
273 | } |