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