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:808ef560b5f6c959cb4f3ceea87f5e38)
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 foreign keys and entity references.
133 * [CRM_Core_Reference_Interface]
135 public static function getReferenceColumns() {
136 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
137 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
138 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
139 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
141 return Civi
::$statics[__CLASS__
]['links'];
145 * Returns all the column names of this table
149 public static function &fields() {
150 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
151 Civi
::$statics[__CLASS__
]['fields'] = [
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('MailingAB ID'),
157 'where' => 'civicrm_mailing_abtest.id',
158 'table_name' => 'civicrm_mailing_abtest',
159 'entity' => 'MailingAB',
160 'bao' => 'CRM_Mailing_BAO_MailingAB',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Name'),
167 'description' => ts('Name of the A/B test'),
169 'size' => CRM_Utils_Type
::HUGE
,
170 'where' => 'civicrm_mailing_abtest.name',
171 'table_name' => 'civicrm_mailing_abtest',
172 'entity' => 'MailingAB',
173 'bao' => 'CRM_Mailing_BAO_MailingAB',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Status'),
180 'description' => ts('Status'),
182 'size' => CRM_Utils_Type
::MEDIUM
,
183 'where' => 'civicrm_mailing_abtest.status',
184 'table_name' => 'civicrm_mailing_abtest',
185 'entity' => 'MailingAB',
186 'bao' => 'CRM_Mailing_BAO_MailingAB',
188 'pseudoconstant' => [
189 'callback' => 'CRM_Mailing_PseudoConstant::abStatus',
193 'name' => 'mailing_id_a',
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Mailing ID (A)'),
196 'description' => ts('The first experimental mailing ("A" condition)'),
197 'where' => 'civicrm_mailing_abtest.mailing_id_a',
198 'table_name' => 'civicrm_mailing_abtest',
199 'entity' => 'MailingAB',
200 'bao' => 'CRM_Mailing_BAO_MailingAB',
204 'name' => 'mailing_id_b',
205 'type' => CRM_Utils_Type
::T_INT
,
206 'title' => ts('Mailing ID (B)'),
207 'description' => ts('The second experimental mailing ("B" condition)'),
208 'where' => 'civicrm_mailing_abtest.mailing_id_b',
209 'table_name' => 'civicrm_mailing_abtest',
210 'entity' => 'MailingAB',
211 'bao' => 'CRM_Mailing_BAO_MailingAB',
215 'name' => 'mailing_id_c',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Mailing ID (C)'),
218 'description' => ts('The final, general mailing (derived from A or B)'),
219 'where' => 'civicrm_mailing_abtest.mailing_id_c',
220 'table_name' => 'civicrm_mailing_abtest',
221 'entity' => 'MailingAB',
222 'bao' => 'CRM_Mailing_BAO_MailingAB',
226 'name' => 'domain_id',
227 'type' => CRM_Utils_Type
::T_INT
,
228 'title' => ts('Domain ID'),
229 'description' => ts('Which site is this mailing for'),
231 'where' => 'civicrm_mailing_abtest.domain_id',
232 'table_name' => 'civicrm_mailing_abtest',
233 'entity' => 'MailingAB',
234 'bao' => 'CRM_Mailing_BAO_MailingAB',
237 'testing_criteria' => [
238 'name' => 'testing_criteria',
239 'type' => CRM_Utils_Type
::T_STRING
,
240 'title' => ts('Testing Criteria'),
242 'size' => CRM_Utils_Type
::MEDIUM
,
243 'where' => 'civicrm_mailing_abtest.testing_criteria',
244 'table_name' => 'civicrm_mailing_abtest',
245 'entity' => 'MailingAB',
246 'bao' => 'CRM_Mailing_BAO_MailingAB',
248 'pseudoconstant' => [
249 'callback' => 'CRM_Mailing_PseudoConstant::abTestCriteria',
252 'winner_criteria' => [
253 'name' => 'winner_criteria',
254 'type' => CRM_Utils_Type
::T_STRING
,
255 'title' => ts('Winner Criteria'),
257 'size' => CRM_Utils_Type
::MEDIUM
,
258 'where' => 'civicrm_mailing_abtest.winner_criteria',
259 'table_name' => 'civicrm_mailing_abtest',
260 'entity' => 'MailingAB',
261 'bao' => 'CRM_Mailing_BAO_MailingAB',
263 'pseudoconstant' => [
264 'callback' => 'CRM_Mailing_PseudoConstant::abWinnerCriteria',
268 'name' => 'specific_url',
269 'type' => CRM_Utils_Type
::T_STRING
,
270 'title' => ts('URL for Winner Criteria'),
271 'description' => ts('What specific url to track'),
273 'size' => CRM_Utils_Type
::HUGE
,
274 'where' => 'civicrm_mailing_abtest.specific_url',
275 'table_name' => 'civicrm_mailing_abtest',
276 'entity' => 'MailingAB',
277 'bao' => 'CRM_Mailing_BAO_MailingAB',
280 'declare_winning_time' => [
281 'name' => 'declare_winning_time',
282 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
283 'title' => ts('Declaration Time'),
284 'description' => ts('In how much time to declare winner'),
285 'where' => 'civicrm_mailing_abtest.declare_winning_time',
286 'table_name' => 'civicrm_mailing_abtest',
287 'entity' => 'MailingAB',
288 'bao' => 'CRM_Mailing_BAO_MailingAB',
291 'group_percentage' => [
292 'name' => 'group_percentage',
293 'type' => CRM_Utils_Type
::T_INT
,
294 'title' => ts('Group Percentage'),
295 'where' => 'civicrm_mailing_abtest.group_percentage',
296 'table_name' => 'civicrm_mailing_abtest',
297 'entity' => 'MailingAB',
298 'bao' => 'CRM_Mailing_BAO_MailingAB',
302 'name' => 'created_id',
303 'type' => CRM_Utils_Type
::T_INT
,
304 'title' => ts('AB Test Created By'),
305 'description' => ts('FK to Contact ID'),
306 'where' => 'civicrm_mailing_abtest.created_id',
307 'table_name' => 'civicrm_mailing_abtest',
308 'entity' => 'MailingAB',
309 'bao' => 'CRM_Mailing_BAO_MailingAB',
311 'FKClassName' => 'CRM_Contact_DAO_Contact',
314 'name' => 'created_date',
315 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
316 'title' => ts('AB Test Created Date'),
317 'description' => ts('When was this item created'),
319 'where' => 'civicrm_mailing_abtest.created_date',
320 'default' => 'CURRENT_TIMESTAMP',
321 'table_name' => 'civicrm_mailing_abtest',
322 'entity' => 'MailingAB',
323 'bao' => 'CRM_Mailing_BAO_MailingAB',
326 'type' => 'Select Date',
330 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
332 return Civi
::$statics[__CLASS__
]['fields'];
336 * Return a mapping from field-name to the corresponding key (as used in fields()).
339 * Array(string $name => string $uniqueName).
341 public static function &fieldKeys() {
342 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
343 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
345 return Civi
::$statics[__CLASS__
]['fieldKeys'];
349 * Returns the names of this table
353 public static function getTableName() {
354 return self
::$_tableName;
358 * Returns if this table needs to be logged
362 public function getLog() {
367 * Returns the list of fields that can be imported
369 * @param bool $prefix
373 public static function &import($prefix = FALSE) {
374 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_abtest', $prefix, []);
379 * Returns the list of fields that can be exported
381 * @param bool $prefix
385 public static function &export($prefix = FALSE) {
386 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_abtest', $prefix, []);
391 * Returns the list of indices
393 * @param bool $localize
397 public static function indices($localize = TRUE) {
399 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;