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:34704091aa51693971aaab2d2ac7c1cf)
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',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('Name') ,
175 'description' => 'Name of the A/B test',
177 'size' => CRM_Utils_Type
::HUGE
,
178 'table_name' => 'civicrm_mailing_abtest',
179 'entity' => 'MailingAB',
180 'bao' => 'CRM_Mailing_BAO_MailingAB',
184 'type' => CRM_Utils_Type
::T_STRING
,
185 'title' => ts('Status') ,
186 'description' => 'Status',
188 'size' => CRM_Utils_Type
::MEDIUM
,
189 'table_name' => 'civicrm_mailing_abtest',
190 'entity' => 'MailingAB',
191 'bao' => 'CRM_Mailing_BAO_MailingAB',
192 'pseudoconstant' => array(
193 'callback' => 'CRM_Mailing_PseudoConstant::abStatus',
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)',
201 'table_name' => 'civicrm_mailing_abtest',
202 'entity' => 'MailingAB',
203 'bao' => 'CRM_Mailing_BAO_MailingAB',
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)',
210 'table_name' => 'civicrm_mailing_abtest',
211 'entity' => 'MailingAB',
212 'bao' => 'CRM_Mailing_BAO_MailingAB',
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)',
219 'table_name' => 'civicrm_mailing_abtest',
220 'entity' => 'MailingAB',
221 'bao' => 'CRM_Mailing_BAO_MailingAB',
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',
228 'table_name' => 'civicrm_mailing_abtest',
229 'entity' => 'MailingAB',
230 'bao' => 'CRM_Mailing_BAO_MailingAB',
232 'testing_criteria' => array(
233 'name' => 'testing_criteria',
234 'type' => CRM_Utils_Type
::T_STRING
,
235 'title' => ts('Testing Criteria') ,
237 'size' => CRM_Utils_Type
::MEDIUM
,
238 'table_name' => 'civicrm_mailing_abtest',
239 'entity' => 'MailingAB',
240 'bao' => 'CRM_Mailing_BAO_MailingAB',
241 'pseudoconstant' => array(
242 'callback' => 'CRM_Mailing_PseudoConstant::abTestCriteria',
245 'winner_criteria' => array(
246 'name' => 'winner_criteria',
247 'type' => CRM_Utils_Type
::T_STRING
,
248 'title' => ts('Winner Criteria') ,
250 'size' => CRM_Utils_Type
::MEDIUM
,
251 'table_name' => 'civicrm_mailing_abtest',
252 'entity' => 'MailingAB',
253 'bao' => 'CRM_Mailing_BAO_MailingAB',
254 'pseudoconstant' => array(
255 'callback' => 'CRM_Mailing_PseudoConstant::abWinnerCriteria',
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',
264 'size' => CRM_Utils_Type
::HUGE
,
265 'table_name' => 'civicrm_mailing_abtest',
266 'entity' => 'MailingAB',
267 'bao' => 'CRM_Mailing_BAO_MailingAB',
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',
274 'table_name' => 'civicrm_mailing_abtest',
275 'entity' => 'MailingAB',
276 'bao' => 'CRM_Mailing_BAO_MailingAB',
278 'group_percentage' => array(
279 'name' => 'group_percentage',
280 'type' => CRM_Utils_Type
::T_INT
,
281 'title' => ts('Group Percentage') ,
282 'table_name' => 'civicrm_mailing_abtest',
283 'entity' => 'MailingAB',
284 'bao' => 'CRM_Mailing_BAO_MailingAB',
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',
291 'table_name' => 'civicrm_mailing_abtest',
292 'entity' => 'MailingAB',
293 'bao' => 'CRM_Mailing_BAO_MailingAB',
294 'FKClassName' => 'CRM_Contact_DAO_Contact',
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',
301 'table_name' => 'civicrm_mailing_abtest',
302 'entity' => 'MailingAB',
303 'bao' => 'CRM_Mailing_BAO_MailingAB',
305 'type' => 'Select Date',
309 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
311 return Civi
::$statics[__CLASS__
]['fields'];
314 * Return a mapping from field-name to the corresponding key (as used in fields()).
317 * Array(string $name => string $uniqueName).
319 static function &fieldKeys() {
320 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
321 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
323 return Civi
::$statics[__CLASS__
]['fieldKeys'];
326 * Returns the names of this table
330 static function getTableName() {
331 return self
::$_tableName;
334 * Returns if this table needs to be logged
342 * Returns the list of fields that can be imported
344 * @param bool $prefix
348 static function &import($prefix = false) {
349 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_abtest', $prefix, array());
353 * Returns the list of fields that can be exported
355 * @param bool $prefix
359 static function &export($prefix = false) {
360 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_abtest', $prefix, array());