3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Mailing/MailingAB.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:fea3382fd8611956ff04827237800b49)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Mailing_DAO_MailingAB constructor.
40 class CRM_Mailing_DAO_MailingAB
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_mailing_abtest';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
59 * Name of the A/B test
71 * The first experimental mailing ("A" condition)
77 * The second experimental mailing ("B" condition)
83 * The final, general mailing (derived from A or B)
89 * Which site is this mailing for
98 public $testing_criteria;
103 public $winner_criteria;
105 * What specific url to track
109 public $specific_url;
111 * In how much time to declare winner
115 public $declare_winning_time;
120 public $group_percentage;
128 * When was this item created
132 public $created_date;
136 function __construct() {
137 $this->__table
= 'civicrm_mailing_abtest';
138 parent
::__construct();
141 * Returns foreign keys and entity references.
144 * [CRM_Core_Reference_Interface]
146 static function getReferenceColumns() {
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']);
152 return Civi
::$statics[__CLASS__
]['links'];
155 * Returns all the column names of this table
159 static function &fields() {
160 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
161 Civi
::$statics[__CLASS__
]['fields'] = array(
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('MailingAB ID') ,
167 'table_name' => 'civicrm_mailing_abtest',
168 'entity' => 'MailingAB',
169 'bao' => 'CRM_Mailing_BAO_MailingAB',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Name') ,
176 'description' => 'Name of the A/B test',
178 'size' => CRM_Utils_Type
::HUGE
,
179 'table_name' => 'civicrm_mailing_abtest',
180 'entity' => 'MailingAB',
181 'bao' => 'CRM_Mailing_BAO_MailingAB',
186 'type' => CRM_Utils_Type
::T_STRING
,
187 'title' => ts('Status') ,
188 'description' => 'Status',
190 'size' => CRM_Utils_Type
::MEDIUM
,
191 'table_name' => 'civicrm_mailing_abtest',
192 'entity' => 'MailingAB',
193 'bao' => 'CRM_Mailing_BAO_MailingAB',
195 'pseudoconstant' => array(
196 'callback' => 'CRM_Mailing_PseudoConstant::abStatus',
199 'mailing_id_a' => array(
200 'name' => 'mailing_id_a',
201 'type' => CRM_Utils_Type
::T_INT
,
202 'title' => ts('Mailing ID (A)') ,
203 'description' => 'The first experimental mailing ("A" condition)',
204 'table_name' => 'civicrm_mailing_abtest',
205 'entity' => 'MailingAB',
206 'bao' => 'CRM_Mailing_BAO_MailingAB',
209 'mailing_id_b' => array(
210 'name' => 'mailing_id_b',
211 'type' => CRM_Utils_Type
::T_INT
,
212 'title' => ts('Mailing ID (B)') ,
213 'description' => 'The second experimental mailing ("B" condition)',
214 'table_name' => 'civicrm_mailing_abtest',
215 'entity' => 'MailingAB',
216 'bao' => 'CRM_Mailing_BAO_MailingAB',
219 'mailing_id_c' => array(
220 'name' => 'mailing_id_c',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Mailing ID (C)') ,
223 'description' => 'The final, general mailing (derived from A or B)',
224 'table_name' => 'civicrm_mailing_abtest',
225 'entity' => 'MailingAB',
226 'bao' => 'CRM_Mailing_BAO_MailingAB',
229 'domain_id' => array(
230 'name' => 'domain_id',
231 'type' => CRM_Utils_Type
::T_INT
,
232 'title' => ts('Domain ID') ,
233 'description' => 'Which site is this mailing for',
234 'table_name' => 'civicrm_mailing_abtest',
235 'entity' => 'MailingAB',
236 'bao' => 'CRM_Mailing_BAO_MailingAB',
239 'testing_criteria' => array(
240 'name' => 'testing_criteria',
241 'type' => CRM_Utils_Type
::T_STRING
,
242 'title' => ts('Testing Criteria') ,
244 'size' => CRM_Utils_Type
::MEDIUM
,
245 'table_name' => 'civicrm_mailing_abtest',
246 'entity' => 'MailingAB',
247 'bao' => 'CRM_Mailing_BAO_MailingAB',
249 'pseudoconstant' => array(
250 'callback' => 'CRM_Mailing_PseudoConstant::abTestCriteria',
253 'winner_criteria' => array(
254 'name' => 'winner_criteria',
255 'type' => CRM_Utils_Type
::T_STRING
,
256 'title' => ts('Winner Criteria') ,
258 'size' => CRM_Utils_Type
::MEDIUM
,
259 'table_name' => 'civicrm_mailing_abtest',
260 'entity' => 'MailingAB',
261 'bao' => 'CRM_Mailing_BAO_MailingAB',
263 'pseudoconstant' => array(
264 'callback' => 'CRM_Mailing_PseudoConstant::abWinnerCriteria',
267 'specific_url' => array(
268 'name' => 'specific_url',
269 'type' => CRM_Utils_Type
::T_STRING
,
270 'title' => ts('URL for Winner Criteria') ,
271 'description' => 'What specific url to track',
273 'size' => CRM_Utils_Type
::HUGE
,
274 'table_name' => 'civicrm_mailing_abtest',
275 'entity' => 'MailingAB',
276 'bao' => 'CRM_Mailing_BAO_MailingAB',
279 'declare_winning_time' => array(
280 'name' => 'declare_winning_time',
281 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
282 'title' => ts('Declaration Time') ,
283 'description' => 'In how much time to declare winner',
284 'table_name' => 'civicrm_mailing_abtest',
285 'entity' => 'MailingAB',
286 'bao' => 'CRM_Mailing_BAO_MailingAB',
289 'group_percentage' => array(
290 'name' => 'group_percentage',
291 'type' => CRM_Utils_Type
::T_INT
,
292 'title' => ts('Group Percentage') ,
293 'table_name' => 'civicrm_mailing_abtest',
294 'entity' => 'MailingAB',
295 'bao' => 'CRM_Mailing_BAO_MailingAB',
298 'created_id' => array(
299 'name' => 'created_id',
300 'type' => CRM_Utils_Type
::T_INT
,
301 'title' => ts('AB Test Created By') ,
302 'description' => 'FK to Contact ID',
303 'table_name' => 'civicrm_mailing_abtest',
304 'entity' => 'MailingAB',
305 'bao' => 'CRM_Mailing_BAO_MailingAB',
307 'FKClassName' => 'CRM_Contact_DAO_Contact',
309 'created_date' => array(
310 'name' => 'created_date',
311 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
312 'title' => ts('AB Test Created Date') ,
313 'description' => 'When was this item created',
314 'table_name' => 'civicrm_mailing_abtest',
315 'entity' => 'MailingAB',
316 'bao' => 'CRM_Mailing_BAO_MailingAB',
319 'type' => 'Select Date',
323 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
325 return Civi
::$statics[__CLASS__
]['fields'];
328 * Return a mapping from field-name to the corresponding key (as used in fields()).
331 * Array(string $name => string $uniqueName).
333 static function &fieldKeys() {
334 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
335 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
337 return Civi
::$statics[__CLASS__
]['fieldKeys'];
340 * Returns the names of this table
344 static function getTableName() {
345 return self
::$_tableName;
348 * Returns if this table needs to be logged
356 * Returns the list of fields that can be imported
358 * @param bool $prefix
362 static function &import($prefix = false) {
363 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_abtest', $prefix, array());
367 * Returns the list of fields that can be exported
369 * @param bool $prefix
373 static function &export($prefix = false) {
374 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_abtest', $prefix, array());