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