Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Mailing/Event/Opened.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
2562d09a | 9 | * (GenCodeChecksum:eb80ba7a01169cc0320fb2807c873291) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Opened entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Mailing_Event_DAO_Opened extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = ''; | |
d31fb4e3 | 18 | const COMPONENT = 'CiviMail'; |
c3fc2621 | 19 | |
e501603b | 20 | /** |
f41f0342 | 21 | * Static instance to hold the table name. |
e501603b TO |
22 | * |
23 | * @var string | |
24 | */ | |
fa45b5b9 | 25 | public static $_tableName = 'civicrm_mailing_event_opened'; |
c3fc2621 | 26 | |
e501603b | 27 | /** |
f41f0342 | 28 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 29 | * |
c3fc2621 | 30 | * @var bool |
e501603b | 31 | */ |
fa45b5b9 | 32 | public static $_log = FALSE; |
c3fc2621 | 33 | |
e501603b | 34 | /** |
e6ca0a57 | 35 | * @var int |
e501603b TO |
36 | */ |
37 | public $id; | |
c3fc2621 | 38 | |
e501603b TO |
39 | /** |
40 | * FK to EventQueue | |
41 | * | |
e6ca0a57 | 42 | * @var int |
e501603b TO |
43 | */ |
44 | public $event_queue_id; | |
c3fc2621 | 45 | |
e501603b TO |
46 | /** |
47 | * When this open event occurred. | |
48 | * | |
6c2b97b7 | 49 | * @var timestamp |
e501603b TO |
50 | */ |
51 | public $time_stamp; | |
c3fc2621 | 52 | |
e501603b | 53 | /** |
f41f0342 | 54 | * Class constructor. |
e501603b | 55 | */ |
c3fc2621 | 56 | public function __construct() { |
e501603b TO |
57 | $this->__table = 'civicrm_mailing_event_opened'; |
58 | parent::__construct(); | |
59 | } | |
c3fc2621 | 60 | |
449c4e6b CW |
61 | /** |
62 | * Returns localized title of this entity. | |
7b66c3b5 AH |
63 | * |
64 | * @param bool $plural | |
65 | * Whether to return the plural version of the title. | |
449c4e6b | 66 | */ |
7b66c3b5 | 67 | public static function getEntityTitle($plural = FALSE) { |
65efffdd | 68 | return $plural ? ts('Mailing Opened Events') : ts('Mailing Opened Event'); |
449c4e6b CW |
69 | } |
70 | ||
e501603b | 71 | /** |
f41f0342 | 72 | * Returns foreign keys and entity references. |
e501603b TO |
73 | * |
74 | * @return array | |
75 | * [CRM_Core_Reference_Interface] | |
76 | */ | |
c3fc2621 | 77 | public static function getReferenceColumns() { |
346aaaba | 78 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
a36434b9 | 79 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 | 80 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); |
346aaaba | 81 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 82 | } |
346aaaba | 83 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 84 | } |
c3fc2621 | 85 | |
e501603b TO |
86 | /** |
87 | * Returns all the column names of this table | |
88 | * | |
89 | * @return array | |
90 | */ | |
c3fc2621 | 91 | public static function &fields() { |
346aaaba | 92 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
93 | Civi::$statics[__CLASS__]['fields'] = [ |
94 | 'id' => [ | |
e501603b TO |
95 | 'name' => 'id', |
96 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
97 | 'title' => ts('Mailing Opened ID'), |
98 | 'required' => TRUE, | |
a36434b9 | 99 | 'where' => 'civicrm_mailing_event_opened.id', |
522a26c9 | 100 | 'table_name' => 'civicrm_mailing_event_opened', |
101 | 'entity' => 'Opened', | |
102 | 'bao' => 'CRM_Mailing_Event_BAO_Opened', | |
6a7e5e5d | 103 | 'localizable' => 0, |
2cbbebe8 A |
104 | 'html' => [ |
105 | 'type' => 'Number', | |
106 | ], | |
1fe423d6 | 107 | 'readonly' => TRUE, |
a9d0587b | 108 | 'add' => NULL, |
c3fc2621 CW |
109 | ], |
110 | 'event_queue_id' => [ | |
e501603b TO |
111 | 'name' => 'event_queue_id', |
112 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 113 | 'title' => ts('Event Queue ID'), |
215b423e | 114 | 'description' => ts('FK to EventQueue'), |
c3fc2621 | 115 | 'required' => TRUE, |
a36434b9 | 116 | 'where' => 'civicrm_mailing_event_opened.event_queue_id', |
522a26c9 | 117 | 'table_name' => 'civicrm_mailing_event_opened', |
118 | 'entity' => 'Opened', | |
119 | 'bao' => 'CRM_Mailing_Event_BAO_Opened', | |
6a7e5e5d | 120 | 'localizable' => 0, |
e501603b | 121 | 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', |
2cbbebe8 A |
122 | 'html' => [ |
123 | 'label' => ts("Event Queue"), | |
124 | ], | |
a9d0587b | 125 | 'add' => NULL, |
c3fc2621 CW |
126 | ], |
127 | 'time_stamp' => [ | |
e501603b | 128 | 'name' => 'time_stamp', |
6c2b97b7 | 129 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
c3fc2621 | 130 | 'title' => ts('Timestamp'), |
215b423e | 131 | 'description' => ts('When this open event occurred.'), |
c3fc2621 | 132 | 'required' => TRUE, |
a36434b9 | 133 | 'where' => 'civicrm_mailing_event_opened.time_stamp', |
6c2b97b7 | 134 | 'default' => 'CURRENT_TIMESTAMP', |
522a26c9 | 135 | 'table_name' => 'civicrm_mailing_event_opened', |
136 | 'entity' => 'Opened', | |
137 | 'bao' => 'CRM_Mailing_Event_BAO_Opened', | |
6a7e5e5d | 138 | 'localizable' => 0, |
a9d0587b | 139 | 'add' => NULL, |
c3fc2621 CW |
140 | ], |
141 | ]; | |
346aaaba | 142 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 143 | } |
346aaaba | 144 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 145 | } |
c3fc2621 | 146 | |
e501603b | 147 | /** |
bd8e0b14 | 148 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
149 | * |
150 | * @return array | |
bd8e0b14 | 151 | * Array(string $name => string $uniqueName). |
e501603b | 152 | */ |
c3fc2621 | 153 | public static function &fieldKeys() { |
bd8e0b14 TO |
154 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
155 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 156 | } |
bd8e0b14 | 157 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 158 | } |
c3fc2621 | 159 | |
e501603b TO |
160 | /** |
161 | * Returns the names of this table | |
162 | * | |
163 | * @return string | |
164 | */ | |
c3fc2621 | 165 | public static function getTableName() { |
e501603b TO |
166 | return self::$_tableName; |
167 | } | |
c3fc2621 | 168 | |
e501603b TO |
169 | /** |
170 | * Returns if this table needs to be logged | |
171 | * | |
c3fc2621 | 172 | * @return bool |
e501603b | 173 | */ |
c3fc2621 | 174 | public function getLog() { |
e501603b TO |
175 | return self::$_log; |
176 | } | |
c3fc2621 | 177 | |
e501603b TO |
178 | /** |
179 | * Returns the list of fields that can be imported | |
180 | * | |
181 | * @param bool $prefix | |
182 | * | |
183 | * @return array | |
184 | */ | |
c3fc2621 CW |
185 | public static function &import($prefix = FALSE) { |
186 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_opened', $prefix, []); | |
60808919 | 187 | return $r; |
e501603b | 188 | } |
c3fc2621 | 189 | |
e501603b TO |
190 | /** |
191 | * Returns the list of fields that can be exported | |
192 | * | |
193 | * @param bool $prefix | |
194 | * | |
195 | * @return array | |
196 | */ | |
c3fc2621 CW |
197 | public static function &export($prefix = FALSE) { |
198 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_opened', $prefix, []); | |
60808919 | 199 | return $r; |
e501603b | 200 | } |
c3fc2621 | 201 | |
e7a6b91a AS |
202 | /** |
203 | * Returns the list of indices | |
c3fc2621 CW |
204 | * |
205 | * @param bool $localize | |
206 | * | |
207 | * @return array | |
e7a6b91a AS |
208 | */ |
209 | public static function indices($localize = TRUE) { | |
c3fc2621 | 210 | $indices = []; |
e7a6b91a AS |
211 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
212 | } | |
c3fc2621 | 213 | |
e501603b | 214 | } |