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