5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/MailingAB.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:fd7f00955d0a5eb4ec56089ccd71f68d)
13 * Database access object for the MailingAB entity.
15 class CRM_Mailing_DAO_MailingAB
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing_abtest';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * Name of the A/B test
51 * The first experimental mailing ("A" condition)
58 * The second experimental mailing ("B" condition)
65 * The final, general mailing (derived from A or B)
72 * Which site is this mailing for
81 public $testing_criteria;
86 public $winner_criteria;
89 * What specific url to track
96 * In how much time to declare winner
100 public $declare_winning_time;
105 public $group_percentage;
115 * When was this item created
119 public $created_date;
124 public function __construct() {
125 $this->__table
= 'civicrm_mailing_abtest';
126 parent
::__construct();
130 * Returns localized title of this entity.
132 public static function getEntityTitle() {
133 return ts('Mailing ABs');
137 * Returns foreign keys and entity references.
140 * [CRM_Core_Reference_Interface]
142 public static function getReferenceColumns() {
143 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
144 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
145 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
146 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
148 return Civi
::$statics[__CLASS__
]['links'];
152 * Returns all the column names of this table
156 public static function &fields() {
157 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
158 Civi
::$statics[__CLASS__
]['fields'] = [
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('MailingAB ID'),
164 'where' => 'civicrm_mailing_abtest.id',
165 'table_name' => 'civicrm_mailing_abtest',
166 'entity' => 'MailingAB',
167 'bao' => 'CRM_Mailing_BAO_MailingAB',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('Name'),
175 'description' => ts('Name of the A/B test'),
177 'size' => CRM_Utils_Type
::HUGE
,
178 'where' => 'civicrm_mailing_abtest.name',
179 'table_name' => 'civicrm_mailing_abtest',
180 'entity' => 'MailingAB',
181 'bao' => 'CRM_Mailing_BAO_MailingAB',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('Status'),
189 'description' => ts('Status'),
191 'size' => CRM_Utils_Type
::MEDIUM
,
192 'where' => 'civicrm_mailing_abtest.status',
193 'table_name' => 'civicrm_mailing_abtest',
194 'entity' => 'MailingAB',
195 'bao' => 'CRM_Mailing_BAO_MailingAB',
197 'pseudoconstant' => [
198 'callback' => 'CRM_Mailing_PseudoConstant::abStatus',
203 'name' => 'mailing_id_a',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Mailing ID (A)'),
206 'description' => ts('The first experimental mailing ("A" condition)'),
207 'where' => 'civicrm_mailing_abtest.mailing_id_a',
208 'table_name' => 'civicrm_mailing_abtest',
209 'entity' => 'MailingAB',
210 'bao' => 'CRM_Mailing_BAO_MailingAB',
215 'name' => 'mailing_id_b',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Mailing ID (B)'),
218 'description' => ts('The second experimental mailing ("B" condition)'),
219 'where' => 'civicrm_mailing_abtest.mailing_id_b',
220 'table_name' => 'civicrm_mailing_abtest',
221 'entity' => 'MailingAB',
222 'bao' => 'CRM_Mailing_BAO_MailingAB',
227 'name' => 'mailing_id_c',
228 'type' => CRM_Utils_Type
::T_INT
,
229 'title' => ts('Mailing ID (C)'),
230 'description' => ts('The final, general mailing (derived from A or B)'),
231 'where' => 'civicrm_mailing_abtest.mailing_id_c',
232 'table_name' => 'civicrm_mailing_abtest',
233 'entity' => 'MailingAB',
234 'bao' => 'CRM_Mailing_BAO_MailingAB',
239 'name' => 'domain_id',
240 'type' => CRM_Utils_Type
::T_INT
,
241 'title' => ts('Domain ID'),
242 'description' => ts('Which site is this mailing for'),
244 'where' => 'civicrm_mailing_abtest.domain_id',
245 'table_name' => 'civicrm_mailing_abtest',
246 'entity' => 'MailingAB',
247 'bao' => 'CRM_Mailing_BAO_MailingAB',
251 'testing_criteria' => [
252 'name' => 'testing_criteria',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('Testing Criteria'),
256 'size' => CRM_Utils_Type
::MEDIUM
,
257 'where' => 'civicrm_mailing_abtest.testing_criteria',
258 'table_name' => 'civicrm_mailing_abtest',
259 'entity' => 'MailingAB',
260 'bao' => 'CRM_Mailing_BAO_MailingAB',
262 'pseudoconstant' => [
263 'callback' => 'CRM_Mailing_PseudoConstant::abTestCriteria',
267 'winner_criteria' => [
268 'name' => 'winner_criteria',
269 'type' => CRM_Utils_Type
::T_STRING
,
270 'title' => ts('Winner Criteria'),
272 'size' => CRM_Utils_Type
::MEDIUM
,
273 'where' => 'civicrm_mailing_abtest.winner_criteria',
274 'table_name' => 'civicrm_mailing_abtest',
275 'entity' => 'MailingAB',
276 'bao' => 'CRM_Mailing_BAO_MailingAB',
278 'pseudoconstant' => [
279 'callback' => 'CRM_Mailing_PseudoConstant::abWinnerCriteria',
284 'name' => 'specific_url',
285 'type' => CRM_Utils_Type
::T_STRING
,
286 'title' => ts('URL for Winner Criteria'),
287 'description' => ts('What specific url to track'),
289 'size' => CRM_Utils_Type
::HUGE
,
290 'where' => 'civicrm_mailing_abtest.specific_url',
291 'table_name' => 'civicrm_mailing_abtest',
292 'entity' => 'MailingAB',
293 'bao' => 'CRM_Mailing_BAO_MailingAB',
297 'declare_winning_time' => [
298 'name' => 'declare_winning_time',
299 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
300 'title' => ts('Declaration Time'),
301 'description' => ts('In how much time to declare winner'),
302 'where' => 'civicrm_mailing_abtest.declare_winning_time',
303 'table_name' => 'civicrm_mailing_abtest',
304 'entity' => 'MailingAB',
305 'bao' => 'CRM_Mailing_BAO_MailingAB',
309 'group_percentage' => [
310 'name' => 'group_percentage',
311 'type' => CRM_Utils_Type
::T_INT
,
312 'title' => ts('Group Percentage'),
313 'where' => 'civicrm_mailing_abtest.group_percentage',
314 'table_name' => 'civicrm_mailing_abtest',
315 'entity' => 'MailingAB',
316 'bao' => 'CRM_Mailing_BAO_MailingAB',
321 'name' => 'created_id',
322 'type' => CRM_Utils_Type
::T_INT
,
323 'title' => ts('AB Test Created By'),
324 'description' => ts('FK to Contact ID'),
325 'where' => 'civicrm_mailing_abtest.created_id',
326 'table_name' => 'civicrm_mailing_abtest',
327 'entity' => 'MailingAB',
328 'bao' => 'CRM_Mailing_BAO_MailingAB',
330 'FKClassName' => 'CRM_Contact_DAO_Contact',
334 'name' => 'created_date',
335 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
336 'title' => ts('AB Test Created Date'),
337 'description' => ts('When was this item created'),
339 'where' => 'civicrm_mailing_abtest.created_date',
340 'default' => 'CURRENT_TIMESTAMP',
341 'table_name' => 'civicrm_mailing_abtest',
342 'entity' => 'MailingAB',
343 'bao' => 'CRM_Mailing_BAO_MailingAB',
346 'type' => 'Select Date',
347 'formatType' => 'mailing',
352 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
354 return Civi
::$statics[__CLASS__
]['fields'];
358 * Return a mapping from field-name to the corresponding key (as used in fields()).
361 * Array(string $name => string $uniqueName).
363 public static function &fieldKeys() {
364 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
365 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
367 return Civi
::$statics[__CLASS__
]['fieldKeys'];
371 * Returns the names of this table
375 public static function getTableName() {
376 return self
::$_tableName;
380 * Returns if this table needs to be logged
384 public function getLog() {
389 * Returns the list of fields that can be imported
391 * @param bool $prefix
395 public static function &import($prefix = FALSE) {
396 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_abtest', $prefix, []);
401 * Returns the list of fields that can be exported
403 * @param bool $prefix
407 public static function &export($prefix = FALSE) {
408 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_abtest', $prefix, []);
413 * Returns the list of indices
415 * @param bool $localize
419 public static function indices($localize = TRUE) {
421 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;