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