b66ca4a6fb76c312419dd21d1493a6548c11e893
[civicrm-core.git] / CRM / Mailing / Event / DAO / Confirm.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Mailing/Event/Confirm.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:627a4d86b1b115a52592e04270eadc78)
10 */
11
12 /**
13 * Database access object for the Confirm entity.
14 */
15 class CRM_Mailing_Event_DAO_Confirm extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_mailing_event_confirm';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * @var int unsigned
33 */
34 public $id;
35
36 /**
37 * FK to civicrm_mailing_event_subscribe
38 *
39 * @var int unsigned
40 */
41 public $event_subscribe_id;
42
43 /**
44 * When this confirmation event occurred.
45 *
46 * @var timestamp
47 */
48 public $time_stamp;
49
50 /**
51 * Class constructor.
52 */
53 public function __construct() {
54 $this->__table = 'civicrm_mailing_event_confirm';
55 parent::__construct();
56 }
57
58 /**
59 * Returns foreign keys and entity references.
60 *
61 * @return array
62 * [CRM_Core_Reference_Interface]
63 */
64 public static function getReferenceColumns() {
65 if (!isset(Civi::$statics[__CLASS__]['links'])) {
66 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
67 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_subscribe_id', 'civicrm_mailing_event_subscribe', 'id');
68 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
69 }
70 return Civi::$statics[__CLASS__]['links'];
71 }
72
73 /**
74 * Returns all the column names of this table
75 *
76 * @return array
77 */
78 public static function &fields() {
79 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
80 Civi::$statics[__CLASS__]['fields'] = [
81 'id' => [
82 'name' => 'id',
83 'type' => CRM_Utils_Type::T_INT,
84 'title' => ts('Mailing Confirmation ID'),
85 'required' => TRUE,
86 'table_name' => 'civicrm_mailing_event_confirm',
87 'entity' => 'Confirm',
88 'bao' => 'CRM_Mailing_Event_BAO_Confirm',
89 'localizable' => 0,
90 ],
91 'event_subscribe_id' => [
92 'name' => 'event_subscribe_id',
93 'type' => CRM_Utils_Type::T_INT,
94 'title' => ts('Mailing Subscribe ID'),
95 'description' => ts('FK to civicrm_mailing_event_subscribe'),
96 'required' => TRUE,
97 'table_name' => 'civicrm_mailing_event_confirm',
98 'entity' => 'Confirm',
99 'bao' => 'CRM_Mailing_Event_BAO_Confirm',
100 'localizable' => 0,
101 'FKClassName' => 'CRM_Mailing_Event_DAO_Subscribe',
102 ],
103 'time_stamp' => [
104 'name' => 'time_stamp',
105 'type' => CRM_Utils_Type::T_TIMESTAMP,
106 'title' => ts('Confirm Timestamp'),
107 'description' => ts('When this confirmation event occurred.'),
108 'required' => TRUE,
109 'default' => 'CURRENT_TIMESTAMP',
110 'table_name' => 'civicrm_mailing_event_confirm',
111 'entity' => 'Confirm',
112 'bao' => 'CRM_Mailing_Event_BAO_Confirm',
113 'localizable' => 0,
114 ],
115 ];
116 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
117 }
118 return Civi::$statics[__CLASS__]['fields'];
119 }
120
121 /**
122 * Return a mapping from field-name to the corresponding key (as used in fields()).
123 *
124 * @return array
125 * Array(string $name => string $uniqueName).
126 */
127 public static function &fieldKeys() {
128 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
129 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
130 }
131 return Civi::$statics[__CLASS__]['fieldKeys'];
132 }
133
134 /**
135 * Returns the names of this table
136 *
137 * @return string
138 */
139 public static function getTableName() {
140 return self::$_tableName;
141 }
142
143 /**
144 * Returns if this table needs to be logged
145 *
146 * @return bool
147 */
148 public function getLog() {
149 return self::$_log;
150 }
151
152 /**
153 * Returns the list of fields that can be imported
154 *
155 * @param bool $prefix
156 *
157 * @return array
158 */
159 public static function &import($prefix = FALSE) {
160 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_confirm', $prefix, []);
161 return $r;
162 }
163
164 /**
165 * Returns the list of fields that can be exported
166 *
167 * @param bool $prefix
168 *
169 * @return array
170 */
171 public static function &export($prefix = FALSE) {
172 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_confirm', $prefix, []);
173 return $r;
174 }
175
176 /**
177 * Returns the list of indices
178 *
179 * @param bool $localize
180 *
181 * @return array
182 */
183 public static function indices($localize = TRUE) {
184 $indices = [];
185 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
186 }
187
188 }