SearchKit - Add translatable descriptions to entities
[civicrm-core.git] / CRM / Mailing / Event / DAO / Forward.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/Forward.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:60c155254c97ad953fc07b9244440f4e)
10 */
11
12 /**
13 * Database access object for the Forward entity.
14 */
15 class CRM_Mailing_Event_DAO_Forward 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_forward';
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 * FK to EventQueue for destination
48 *
49 * @var int
50 */
51 public $dest_queue_id;
52
53 /**
54 * When this forward event occurred.
55 *
56 * @var timestamp
57 */
58 public $time_stamp;
59
60 /**
61 * Class constructor.
62 */
63 public function __construct() {
64 $this->__table = 'civicrm_mailing_event_forward';
65 parent::__construct();
66 }
67
68 /**
69 * Returns localized title of this entity.
70 *
71 * @param bool $plural
72 * Whether to return the plural version of the title.
73 */
74 public static function getEntityTitle($plural = FALSE) {
75 return $plural ? ts('Mailing Forwarded Events') : ts('Mailing Forwarded Event');
76 }
77
78 /**
79 * Returns foreign keys and entity references.
80 *
81 * @return array
82 * [CRM_Core_Reference_Interface]
83 */
84 public static function getReferenceColumns() {
85 if (!isset(Civi::$statics[__CLASS__]['links'])) {
86 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
87 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
88 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id');
89 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
90 }
91 return Civi::$statics[__CLASS__]['links'];
92 }
93
94 /**
95 * Returns all the column names of this table
96 *
97 * @return array
98 */
99 public static function &fields() {
100 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
101 Civi::$statics[__CLASS__]['fields'] = [
102 'id' => [
103 'name' => 'id',
104 'type' => CRM_Utils_Type::T_INT,
105 'title' => ts('Forward ID'),
106 'required' => TRUE,
107 'where' => 'civicrm_mailing_event_forward.id',
108 'table_name' => 'civicrm_mailing_event_forward',
109 'entity' => 'Forward',
110 'bao' => 'CRM_Mailing_Event_BAO_Forward',
111 'localizable' => 0,
112 'html' => [
113 'type' => 'Number',
114 ],
115 'readonly' => TRUE,
116 'add' => NULL,
117 ],
118 'event_queue_id' => [
119 'name' => 'event_queue_id',
120 'type' => CRM_Utils_Type::T_INT,
121 'title' => ts('Event Queue ID'),
122 'description' => ts('FK to EventQueue'),
123 'required' => TRUE,
124 'where' => 'civicrm_mailing_event_forward.event_queue_id',
125 'table_name' => 'civicrm_mailing_event_forward',
126 'entity' => 'Forward',
127 'bao' => 'CRM_Mailing_Event_BAO_Forward',
128 'localizable' => 0,
129 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
130 'html' => [
131 'label' => ts("Event Queue"),
132 ],
133 'add' => NULL,
134 ],
135 'dest_queue_id' => [
136 'name' => 'dest_queue_id',
137 'type' => CRM_Utils_Type::T_INT,
138 'title' => ts('Destination Queue ID'),
139 'description' => ts('FK to EventQueue for destination'),
140 'where' => 'civicrm_mailing_event_forward.dest_queue_id',
141 'table_name' => 'civicrm_mailing_event_forward',
142 'entity' => 'Forward',
143 'bao' => 'CRM_Mailing_Event_BAO_Forward',
144 'localizable' => 0,
145 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
146 'html' => [
147 'label' => ts("Destination Queue"),
148 ],
149 'add' => NULL,
150 ],
151 'time_stamp' => [
152 'name' => 'time_stamp',
153 'type' => CRM_Utils_Type::T_TIMESTAMP,
154 'title' => ts('Timestamp'),
155 'description' => ts('When this forward event occurred.'),
156 'required' => TRUE,
157 'where' => 'civicrm_mailing_event_forward.time_stamp',
158 'default' => 'CURRENT_TIMESTAMP',
159 'table_name' => 'civicrm_mailing_event_forward',
160 'entity' => 'Forward',
161 'bao' => 'CRM_Mailing_Event_BAO_Forward',
162 'localizable' => 0,
163 'add' => NULL,
164 ],
165 ];
166 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
167 }
168 return Civi::$statics[__CLASS__]['fields'];
169 }
170
171 /**
172 * Return a mapping from field-name to the corresponding key (as used in fields()).
173 *
174 * @return array
175 * Array(string $name => string $uniqueName).
176 */
177 public static function &fieldKeys() {
178 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
179 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
180 }
181 return Civi::$statics[__CLASS__]['fieldKeys'];
182 }
183
184 /**
185 * Returns the names of this table
186 *
187 * @return string
188 */
189 public static function getTableName() {
190 return self::$_tableName;
191 }
192
193 /**
194 * Returns if this table needs to be logged
195 *
196 * @return bool
197 */
198 public function getLog() {
199 return self::$_log;
200 }
201
202 /**
203 * Returns the list of fields that can be imported
204 *
205 * @param bool $prefix
206 *
207 * @return array
208 */
209 public static function &import($prefix = FALSE) {
210 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_forward', $prefix, []);
211 return $r;
212 }
213
214 /**
215 * Returns the list of fields that can be exported
216 *
217 * @param bool $prefix
218 *
219 * @return array
220 */
221 public static function &export($prefix = FALSE) {
222 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_forward', $prefix, []);
223 return $r;
224 }
225
226 /**
227 * Returns the list of indices
228 *
229 * @param bool $localize
230 *
231 * @return array
232 */
233 public static function indices($localize = TRUE) {
234 $indices = [];
235 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
236 }
237
238 }