Regenerate DAOs with readonly attribute for id fields
[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:c212b4bda46beb9e1f02d5a8664d1890)
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 'html' => [
105 'type' => 'Number',
106 ],
107 'readonly' => TRUE,
108 'add' => NULL,
109 ],
110 'event_queue_id' => [
111 'name' => 'event_queue_id',
112 'type' => CRM_Utils_Type::T_INT,
113 'title' => ts('Event Queue ID'),
114 'description' => ts('FK to EventQueue'),
115 'required' => TRUE,
116 'where' => 'civicrm_mailing_event_delivered.event_queue_id',
117 'table_name' => 'civicrm_mailing_event_delivered',
118 'entity' => 'Delivered',
119 'bao' => 'CRM_Mailing_Event_BAO_Delivered',
120 'localizable' => 0,
121 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
122 'html' => [
123 'label' => ts("Event Queue"),
124 ],
125 'add' => NULL,
126 ],
127 'time_stamp' => [
128 'name' => 'time_stamp',
129 'type' => CRM_Utils_Type::T_TIMESTAMP,
130 'title' => ts('Timestamp'),
131 'description' => ts('When this delivery event occurred.'),
132 'required' => TRUE,
133 'where' => 'civicrm_mailing_event_delivered.time_stamp',
134 'default' => 'CURRENT_TIMESTAMP',
135 'table_name' => 'civicrm_mailing_event_delivered',
136 'entity' => 'Delivered',
137 'bao' => 'CRM_Mailing_Event_BAO_Delivered',
138 'localizable' => 0,
139 'add' => NULL,
140 ],
141 ];
142 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
143 }
144 return Civi::$statics[__CLASS__]['fields'];
145 }
146
147 /**
148 * Return a mapping from field-name to the corresponding key (as used in fields()).
149 *
150 * @return array
151 * Array(string $name => string $uniqueName).
152 */
153 public static function &fieldKeys() {
154 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
155 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
156 }
157 return Civi::$statics[__CLASS__]['fieldKeys'];
158 }
159
160 /**
161 * Returns the names of this table
162 *
163 * @return string
164 */
165 public static function getTableName() {
166 return self::$_tableName;
167 }
168
169 /**
170 * Returns if this table needs to be logged
171 *
172 * @return bool
173 */
174 public function getLog() {
175 return self::$_log;
176 }
177
178 /**
179 * Returns the list of fields that can be imported
180 *
181 * @param bool $prefix
182 *
183 * @return array
184 */
185 public static function &import($prefix = FALSE) {
186 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_delivered', $prefix, []);
187 return $r;
188 }
189
190 /**
191 * Returns the list of fields that can be exported
192 *
193 * @param bool $prefix
194 *
195 * @return array
196 */
197 public static function &export($prefix = FALSE) {
198 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_delivered', $prefix, []);
199 return $r;
200 }
201
202 /**
203 * Returns the list of indices
204 *
205 * @param bool $localize
206 *
207 * @return array
208 */
209 public static function indices($localize = TRUE) {
210 $indices = [];
211 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
212 }
213
214 }