Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
0f03f337 | 6 | | Copyright CiviCRM LLC (c) 2004-2017 | |
e501603b TO |
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 | |
0f03f337 | 29 | * @copyright CiviCRM LLC (c) 2004-2017 |
e501603b TO |
30 | * |
31 | * Generated from xml/schema/CRM/Mailing/MailingAB.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
522a26c9 | 33 | * (GenCodeChecksum:34704091aa51693971aaab2d2ac7c1cf) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
f41f0342 | 37 | /** |
38 | * CRM_Mailing_DAO_MailingAB constructor. | |
39 | */ | |
e501603b TO |
40 | class CRM_Mailing_DAO_MailingAB extends CRM_Core_DAO { |
41 | /** | |
f41f0342 | 42 | * Static instance to hold the table name. |
e501603b TO |
43 | * |
44 | * @var string | |
45 | */ | |
46 | static $_tableName = 'civicrm_mailing_abtest'; | |
e501603b | 47 | /** |
f41f0342 | 48 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b TO |
49 | * |
50 | * @var boolean | |
51 | */ | |
52 | static $_log = false; | |
53 | /** | |
54 | * | |
55 | * @var int unsigned | |
56 | */ | |
57 | public $id; | |
58 | /** | |
59 | * Name of the A/B test | |
60 | * | |
61 | * @var string | |
62 | */ | |
63 | public $name; | |
64 | /** | |
65 | * Status | |
66 | * | |
67 | * @var string | |
68 | */ | |
69 | public $status; | |
70 | /** | |
71 | * The first experimental mailing ("A" condition) | |
72 | * | |
73 | * @var int unsigned | |
74 | */ | |
75 | public $mailing_id_a; | |
76 | /** | |
77 | * The second experimental mailing ("B" condition) | |
78 | * | |
79 | * @var int unsigned | |
80 | */ | |
81 | public $mailing_id_b; | |
82 | /** | |
83 | * The final, general mailing (derived from A or B) | |
84 | * | |
85 | * @var int unsigned | |
86 | */ | |
87 | public $mailing_id_c; | |
88 | /** | |
89 | * Which site is this mailing for | |
90 | * | |
91 | * @var int unsigned | |
92 | */ | |
93 | public $domain_id; | |
94 | /** | |
95 | * | |
96 | * @var string | |
97 | */ | |
98 | public $testing_criteria; | |
99 | /** | |
100 | * | |
101 | * @var string | |
102 | */ | |
103 | public $winner_criteria; | |
104 | /** | |
105 | * What specific url to track | |
106 | * | |
107 | * @var string | |
108 | */ | |
109 | public $specific_url; | |
110 | /** | |
111 | * In how much time to declare winner | |
112 | * | |
113 | * @var datetime | |
114 | */ | |
115 | public $declare_winning_time; | |
116 | /** | |
117 | * | |
118 | * @var int unsigned | |
119 | */ | |
120 | public $group_percentage; | |
121 | /** | |
122 | * FK to Contact ID | |
123 | * | |
124 | * @var int unsigned | |
125 | */ | |
126 | public $created_id; | |
127 | /** | |
128 | * When was this item created | |
129 | * | |
130 | * @var datetime | |
131 | */ | |
132 | public $created_date; | |
133 | /** | |
f41f0342 | 134 | * Class constructor. |
e501603b TO |
135 | */ |
136 | function __construct() { | |
137 | $this->__table = 'civicrm_mailing_abtest'; | |
138 | parent::__construct(); | |
139 | } | |
140 | /** | |
f41f0342 | 141 | * Returns foreign keys and entity references. |
e501603b TO |
142 | * |
143 | * @return array | |
144 | * [CRM_Core_Reference_Interface] | |
145 | */ | |
146 | static function getReferenceColumns() { | |
346aaaba TO |
147 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
148 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
149 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id'); | |
150 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); | |
e501603b | 151 | } |
346aaaba | 152 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
153 | } |
154 | /** | |
155 | * Returns all the column names of this table | |
156 | * | |
157 | * @return array | |
158 | */ | |
159 | static function &fields() { | |
346aaaba TO |
160 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
161 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
162 | 'id' => array( |
163 | 'name' => 'id', | |
164 | 'type' => CRM_Utils_Type::T_INT, | |
165 | 'title' => ts('MailingAB ID') , | |
166 | 'required' => true, | |
522a26c9 | 167 | 'table_name' => 'civicrm_mailing_abtest', |
168 | 'entity' => 'MailingAB', | |
169 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
170 | ) , |
171 | 'name' => array( | |
172 | 'name' => 'name', | |
173 | 'type' => CRM_Utils_Type::T_STRING, | |
174 | 'title' => ts('Name') , | |
175 | 'description' => 'Name of the A/B test', | |
176 | 'maxlength' => 128, | |
177 | 'size' => CRM_Utils_Type::HUGE, | |
522a26c9 | 178 | 'table_name' => 'civicrm_mailing_abtest', |
179 | 'entity' => 'MailingAB', | |
180 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
181 | ) , |
182 | 'status' => array( | |
183 | 'name' => 'status', | |
184 | 'type' => CRM_Utils_Type::T_STRING, | |
185 | 'title' => ts('Status') , | |
186 | 'description' => 'Status', | |
187 | 'maxlength' => 32, | |
188 | 'size' => CRM_Utils_Type::MEDIUM, | |
522a26c9 | 189 | 'table_name' => 'civicrm_mailing_abtest', |
190 | 'entity' => 'MailingAB', | |
191 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
192 | 'pseudoconstant' => array( |
193 | 'callback' => 'CRM_Mailing_PseudoConstant::abStatus', | |
194 | ) | |
195 | ) , | |
196 | 'mailing_id_a' => array( | |
197 | 'name' => 'mailing_id_a', | |
198 | 'type' => CRM_Utils_Type::T_INT, | |
199 | 'title' => ts('Mailing ID (A)') , | |
200 | 'description' => 'The first experimental mailing ("A" condition)', | |
522a26c9 | 201 | 'table_name' => 'civicrm_mailing_abtest', |
202 | 'entity' => 'MailingAB', | |
203 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
204 | ) , |
205 | 'mailing_id_b' => array( | |
206 | 'name' => 'mailing_id_b', | |
207 | 'type' => CRM_Utils_Type::T_INT, | |
208 | 'title' => ts('Mailing ID (B)') , | |
209 | 'description' => 'The second experimental mailing ("B" condition)', | |
522a26c9 | 210 | 'table_name' => 'civicrm_mailing_abtest', |
211 | 'entity' => 'MailingAB', | |
212 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
213 | ) , |
214 | 'mailing_id_c' => array( | |
215 | 'name' => 'mailing_id_c', | |
216 | 'type' => CRM_Utils_Type::T_INT, | |
217 | 'title' => ts('Mailing ID (C)') , | |
218 | 'description' => 'The final, general mailing (derived from A or B)', | |
522a26c9 | 219 | 'table_name' => 'civicrm_mailing_abtest', |
220 | 'entity' => 'MailingAB', | |
221 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
222 | ) , |
223 | 'domain_id' => array( | |
224 | 'name' => 'domain_id', | |
225 | 'type' => CRM_Utils_Type::T_INT, | |
226 | 'title' => ts('Domain ID') , | |
227 | 'description' => 'Which site is this mailing for', | |
522a26c9 | 228 | 'table_name' => 'civicrm_mailing_abtest', |
229 | 'entity' => 'MailingAB', | |
230 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
231 | ) , |
232 | 'testing_criteria' => array( | |
233 | 'name' => 'testing_criteria', | |
234 | 'type' => CRM_Utils_Type::T_STRING, | |
235 | 'title' => ts('Testing Criteria') , | |
236 | 'maxlength' => 32, | |
237 | 'size' => CRM_Utils_Type::MEDIUM, | |
522a26c9 | 238 | 'table_name' => 'civicrm_mailing_abtest', |
239 | 'entity' => 'MailingAB', | |
240 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
241 | 'pseudoconstant' => array( |
242 | 'callback' => 'CRM_Mailing_PseudoConstant::abTestCriteria', | |
243 | ) | |
244 | ) , | |
245 | 'winner_criteria' => array( | |
246 | 'name' => 'winner_criteria', | |
247 | 'type' => CRM_Utils_Type::T_STRING, | |
248 | 'title' => ts('Winner Criteria') , | |
249 | 'maxlength' => 32, | |
250 | 'size' => CRM_Utils_Type::MEDIUM, | |
522a26c9 | 251 | 'table_name' => 'civicrm_mailing_abtest', |
252 | 'entity' => 'MailingAB', | |
253 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
254 | 'pseudoconstant' => array( |
255 | 'callback' => 'CRM_Mailing_PseudoConstant::abWinnerCriteria', | |
256 | ) | |
257 | ) , | |
258 | 'specific_url' => array( | |
259 | 'name' => 'specific_url', | |
260 | 'type' => CRM_Utils_Type::T_STRING, | |
261 | 'title' => ts('URL for Winner Criteria') , | |
262 | 'description' => 'What specific url to track', | |
263 | 'maxlength' => 255, | |
264 | 'size' => CRM_Utils_Type::HUGE, | |
522a26c9 | 265 | 'table_name' => 'civicrm_mailing_abtest', |
266 | 'entity' => 'MailingAB', | |
267 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
268 | ) , |
269 | 'declare_winning_time' => array( | |
270 | 'name' => 'declare_winning_time', | |
271 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
272 | 'title' => ts('Declaration Time') , | |
273 | 'description' => 'In how much time to declare winner', | |
522a26c9 | 274 | 'table_name' => 'civicrm_mailing_abtest', |
275 | 'entity' => 'MailingAB', | |
276 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
277 | ) , |
278 | 'group_percentage' => array( | |
279 | 'name' => 'group_percentage', | |
280 | 'type' => CRM_Utils_Type::T_INT, | |
281 | 'title' => ts('Group Percentage') , | |
522a26c9 | 282 | 'table_name' => 'civicrm_mailing_abtest', |
283 | 'entity' => 'MailingAB', | |
284 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
285 | ) , |
286 | 'created_id' => array( | |
287 | 'name' => 'created_id', | |
288 | 'type' => CRM_Utils_Type::T_INT, | |
289 | 'title' => ts('AB Test Created By') , | |
290 | 'description' => 'FK to Contact ID', | |
522a26c9 | 291 | 'table_name' => 'civicrm_mailing_abtest', |
292 | 'entity' => 'MailingAB', | |
293 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
294 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
295 | ) , | |
296 | 'created_date' => array( | |
297 | 'name' => 'created_date', | |
298 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
299 | 'title' => ts('AB Test Created Date') , | |
300 | 'description' => 'When was this item created', | |
522a26c9 | 301 | 'table_name' => 'civicrm_mailing_abtest', |
302 | 'entity' => 'MailingAB', | |
303 | 'bao' => 'CRM_Mailing_BAO_MailingAB', | |
e501603b TO |
304 | 'html' => array( |
305 | 'type' => 'Select Date', | |
306 | ) , | |
307 | ) , | |
308 | ); | |
346aaaba | 309 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 310 | } |
346aaaba | 311 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
312 | } |
313 | /** | |
bd8e0b14 | 314 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
315 | * |
316 | * @return array | |
bd8e0b14 | 317 | * Array(string $name => string $uniqueName). |
e501603b TO |
318 | */ |
319 | static function &fieldKeys() { | |
bd8e0b14 TO |
320 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
321 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 322 | } |
bd8e0b14 | 323 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
324 | } |
325 | /** | |
326 | * Returns the names of this table | |
327 | * | |
328 | * @return string | |
329 | */ | |
330 | static function getTableName() { | |
331 | return self::$_tableName; | |
332 | } | |
333 | /** | |
334 | * Returns if this table needs to be logged | |
335 | * | |
336 | * @return boolean | |
337 | */ | |
338 | function getLog() { | |
339 | return self::$_log; | |
340 | } | |
341 | /** | |
342 | * Returns the list of fields that can be imported | |
343 | * | |
344 | * @param bool $prefix | |
345 | * | |
346 | * @return array | |
347 | */ | |
348 | static function &import($prefix = false) { | |
60808919 TO |
349 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_abtest', $prefix, array()); |
350 | return $r; | |
e501603b TO |
351 | } |
352 | /** | |
353 | * Returns the list of fields that can be exported | |
354 | * | |
355 | * @param bool $prefix | |
356 | * | |
357 | * @return array | |
358 | */ | |
359 | static function &export($prefix = false) { | |
60808919 TO |
360 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_abtest', $prefix, array()); |
361 | return $r; | |
e501603b TO |
362 | } |
363 | } |