5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/MailingAB.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:12d9514d27712e3d9ad545ca6c2bfe91)
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 static $_tableName = 'civicrm_mailing_abtest';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_mailing_abtest',
158 'entity' => 'MailingAB',
159 'bao' => 'CRM_Mailing_BAO_MailingAB',
164 'type' => CRM_Utils_Type
::T_STRING
,
165 'title' => ts('Name'),
166 'description' => ts('Name of the A/B test'),
168 'size' => CRM_Utils_Type
::HUGE
,
169 'table_name' => 'civicrm_mailing_abtest',
170 'entity' => 'MailingAB',
171 'bao' => 'CRM_Mailing_BAO_MailingAB',
176 'type' => CRM_Utils_Type
::T_STRING
,
177 'title' => ts('Status'),
178 'description' => ts('Status'),
180 'size' => CRM_Utils_Type
::MEDIUM
,
181 'table_name' => 'civicrm_mailing_abtest',
182 'entity' => 'MailingAB',
183 'bao' => 'CRM_Mailing_BAO_MailingAB',
185 'pseudoconstant' => [
186 'callback' => 'CRM_Mailing_PseudoConstant::abStatus',
190 'name' => 'mailing_id_a',
191 'type' => CRM_Utils_Type
::T_INT
,
192 'title' => ts('Mailing ID (A)'),
193 'description' => ts('The first experimental mailing ("A" condition)'),
194 'table_name' => 'civicrm_mailing_abtest',
195 'entity' => 'MailingAB',
196 'bao' => 'CRM_Mailing_BAO_MailingAB',
200 'name' => 'mailing_id_b',
201 'type' => CRM_Utils_Type
::T_INT
,
202 'title' => ts('Mailing ID (B)'),
203 'description' => ts('The second experimental mailing ("B" condition)'),
204 'table_name' => 'civicrm_mailing_abtest',
205 'entity' => 'MailingAB',
206 'bao' => 'CRM_Mailing_BAO_MailingAB',
210 'name' => 'mailing_id_c',
211 'type' => CRM_Utils_Type
::T_INT
,
212 'title' => ts('Mailing ID (C)'),
213 'description' => ts('The final, general mailing (derived from A or B)'),
214 'table_name' => 'civicrm_mailing_abtest',
215 'entity' => 'MailingAB',
216 'bao' => 'CRM_Mailing_BAO_MailingAB',
220 'name' => 'domain_id',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Domain ID'),
223 'description' => ts('Which site is this mailing for'),
224 'table_name' => 'civicrm_mailing_abtest',
225 'entity' => 'MailingAB',
226 'bao' => 'CRM_Mailing_BAO_MailingAB',
229 'testing_criteria' => [
230 'name' => 'testing_criteria',
231 'type' => CRM_Utils_Type
::T_STRING
,
232 'title' => ts('Testing Criteria'),
234 'size' => CRM_Utils_Type
::MEDIUM
,
235 'table_name' => 'civicrm_mailing_abtest',
236 'entity' => 'MailingAB',
237 'bao' => 'CRM_Mailing_BAO_MailingAB',
239 'pseudoconstant' => [
240 'callback' => 'CRM_Mailing_PseudoConstant::abTestCriteria',
243 'winner_criteria' => [
244 'name' => 'winner_criteria',
245 'type' => CRM_Utils_Type
::T_STRING
,
246 'title' => ts('Winner Criteria'),
248 'size' => CRM_Utils_Type
::MEDIUM
,
249 'table_name' => 'civicrm_mailing_abtest',
250 'entity' => 'MailingAB',
251 'bao' => 'CRM_Mailing_BAO_MailingAB',
253 'pseudoconstant' => [
254 'callback' => 'CRM_Mailing_PseudoConstant::abWinnerCriteria',
258 'name' => 'specific_url',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('URL for Winner Criteria'),
261 'description' => ts('What specific url to track'),
263 'size' => CRM_Utils_Type
::HUGE
,
264 'table_name' => 'civicrm_mailing_abtest',
265 'entity' => 'MailingAB',
266 'bao' => 'CRM_Mailing_BAO_MailingAB',
269 'declare_winning_time' => [
270 'name' => 'declare_winning_time',
271 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
272 'title' => ts('Declaration Time'),
273 'description' => ts('In how much time to declare winner'),
274 'table_name' => 'civicrm_mailing_abtest',
275 'entity' => 'MailingAB',
276 'bao' => 'CRM_Mailing_BAO_MailingAB',
279 'group_percentage' => [
280 'name' => 'group_percentage',
281 'type' => CRM_Utils_Type
::T_INT
,
282 'title' => ts('Group Percentage'),
283 'table_name' => 'civicrm_mailing_abtest',
284 'entity' => 'MailingAB',
285 'bao' => 'CRM_Mailing_BAO_MailingAB',
289 'name' => 'created_id',
290 'type' => CRM_Utils_Type
::T_INT
,
291 'title' => ts('AB Test Created By'),
292 'description' => ts('FK to Contact ID'),
293 'table_name' => 'civicrm_mailing_abtest',
294 'entity' => 'MailingAB',
295 'bao' => 'CRM_Mailing_BAO_MailingAB',
297 'FKClassName' => 'CRM_Contact_DAO_Contact',
300 'name' => 'created_date',
301 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
302 'title' => ts('AB Test Created Date'),
303 'description' => ts('When was this item created'),
305 'default' => 'CURRENT_TIMESTAMP',
306 'table_name' => 'civicrm_mailing_abtest',
307 'entity' => 'MailingAB',
308 'bao' => 'CRM_Mailing_BAO_MailingAB',
311 'type' => 'Select Date',
315 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
317 return Civi
::$statics[__CLASS__
]['fields'];
321 * Return a mapping from field-name to the corresponding key (as used in fields()).
324 * Array(string $name => string $uniqueName).
326 public static function &fieldKeys() {
327 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
328 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
330 return Civi
::$statics[__CLASS__
]['fieldKeys'];
334 * Returns the names of this table
338 public static function getTableName() {
339 return self
::$_tableName;
343 * Returns if this table needs to be logged
347 public function getLog() {
352 * Returns the list of fields that can be imported
354 * @param bool $prefix
358 public static function &import($prefix = FALSE) {
359 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_abtest', $prefix, []);
364 * Returns the list of fields that can be exported
366 * @param bool $prefix
370 public static function &export($prefix = FALSE) {
371 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_abtest', $prefix, []);
376 * Returns the list of indices
378 * @param bool $localize
382 public static function indices($localize = TRUE) {
384 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;