[NFC] Re-generate DAOs
[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:868d8d539be2f960708c791e77142cf7)
10 */
11
12 /**
13 * Database access object for the Delivered entity.
14 */
15 class CRM_Mailing_Event_DAO_Delivered 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_delivered';
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
33 */
34 public $id;
35
36 /**
37 * FK to EventQueue
38 *
39 * @var int
40 */
41 public $event_queue_id;
42
43 /**
44 * When this delivery 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_delivered';
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_queue_id', 'civicrm_mailing_event_queue', '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('Delivered ID'),
85 'required' => TRUE,
86 'where' => 'civicrm_mailing_event_delivered.id',
87 'table_name' => 'civicrm_mailing_event_delivered',
88 'entity' => 'Delivered',
89 'bao' => 'CRM_Mailing_Event_BAO_Delivered',
90 'localizable' => 0,
91 ],
92 'event_queue_id' => [
93 'name' => 'event_queue_id',
94 'type' => CRM_Utils_Type::T_INT,
95 'title' => ts('Event Queue'),
96 'description' => ts('FK to EventQueue'),
97 'required' => TRUE,
98 'where' => 'civicrm_mailing_event_delivered.event_queue_id',
99 'table_name' => 'civicrm_mailing_event_delivered',
100 'entity' => 'Delivered',
101 'bao' => 'CRM_Mailing_Event_BAO_Delivered',
102 'localizable' => 0,
103 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
104 ],
105 'time_stamp' => [
106 'name' => 'time_stamp',
107 'type' => CRM_Utils_Type::T_TIMESTAMP,
108 'title' => ts('Timestamp'),
109 'description' => ts('When this delivery event occurred.'),
110 'required' => TRUE,
111 'where' => 'civicrm_mailing_event_delivered.time_stamp',
112 'default' => 'CURRENT_TIMESTAMP',
113 'table_name' => 'civicrm_mailing_event_delivered',
114 'entity' => 'Delivered',
115 'bao' => 'CRM_Mailing_Event_BAO_Delivered',
116 'localizable' => 0,
117 ],
118 ];
119 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
120 }
121 return Civi::$statics[__CLASS__]['fields'];
122 }
123
124 /**
125 * Return a mapping from field-name to the corresponding key (as used in fields()).
126 *
127 * @return array
128 * Array(string $name => string $uniqueName).
129 */
130 public static function &fieldKeys() {
131 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
132 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
133 }
134 return Civi::$statics[__CLASS__]['fieldKeys'];
135 }
136
137 /**
138 * Returns the names of this table
139 *
140 * @return string
141 */
142 public static function getTableName() {
143 return self::$_tableName;
144 }
145
146 /**
147 * Returns if this table needs to be logged
148 *
149 * @return bool
150 */
151 public function getLog() {
152 return self::$_log;
153 }
154
155 /**
156 * Returns the list of fields that can be imported
157 *
158 * @param bool $prefix
159 *
160 * @return array
161 */
162 public static function &import($prefix = FALSE) {
163 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_delivered', $prefix, []);
164 return $r;
165 }
166
167 /**
168 * Returns the list of fields that can be exported
169 *
170 * @param bool $prefix
171 *
172 * @return array
173 */
174 public static function &export($prefix = FALSE) {
175 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_delivered', $prefix, []);
176 return $r;
177 }
178
179 /**
180 * Returns the list of indices
181 *
182 * @param bool $localize
183 *
184 * @return array
185 */
186 public static function indices($localize = TRUE) {
187 $indices = [];
188 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
189 }
190
191 }