Merge pull request #14266 from seamuslee001/dev_core_369
[civicrm-core.git] / CRM / Mailing / Event / DAO / Forward.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Mailing/Event/Forward.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:73d4b00ff9ea00d604d5e83963ba5597)
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 unsigned
33 */
34 public $id;
35
36 /**
37 * FK to EventQueue
38 *
39 * @var int unsigned
40 */
41 public $event_queue_id;
42
43 /**
44 * FK to EventQueue for destination
45 *
46 * @var int unsigned
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 foreign keys and entity references.
67 *
68 * @return array
69 * [CRM_Core_Reference_Interface]
70 */
71 public static function getReferenceColumns() {
72 if (!isset(Civi::$statics[__CLASS__]['links'])) {
73 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
74 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
75 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id');
76 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
77 }
78 return Civi::$statics[__CLASS__]['links'];
79 }
80
81 /**
82 * Returns all the column names of this table
83 *
84 * @return array
85 */
86 public static function &fields() {
87 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
88 Civi::$statics[__CLASS__]['fields'] = [
89 'id' => [
90 'name' => 'id',
91 'type' => CRM_Utils_Type::T_INT,
92 'title' => ts('Forward ID'),
93 'required' => TRUE,
94 'where' => 'civicrm_mailing_event_forward.id',
95 'table_name' => 'civicrm_mailing_event_forward',
96 'entity' => 'Forward',
97 'bao' => 'CRM_Mailing_Event_BAO_Forward',
98 'localizable' => 0,
99 ],
100 'event_queue_id' => [
101 'name' => 'event_queue_id',
102 'type' => CRM_Utils_Type::T_INT,
103 'title' => ts('Mailing Event Queue'),
104 'description' => ts('FK to EventQueue'),
105 'required' => TRUE,
106 'where' => 'civicrm_mailing_event_forward.event_queue_id',
107 'table_name' => 'civicrm_mailing_event_forward',
108 'entity' => 'Forward',
109 'bao' => 'CRM_Mailing_Event_BAO_Forward',
110 'localizable' => 0,
111 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
112 ],
113 'dest_queue_id' => [
114 'name' => 'dest_queue_id',
115 'type' => CRM_Utils_Type::T_INT,
116 'title' => ts('Destination Queue'),
117 'description' => ts('FK to EventQueue for destination'),
118 'where' => 'civicrm_mailing_event_forward.dest_queue_id',
119 'table_name' => 'civicrm_mailing_event_forward',
120 'entity' => 'Forward',
121 'bao' => 'CRM_Mailing_Event_BAO_Forward',
122 'localizable' => 0,
123 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
124 ],
125 'time_stamp' => [
126 'name' => 'time_stamp',
127 'type' => CRM_Utils_Type::T_TIMESTAMP,
128 'title' => ts('Timestamp'),
129 'description' => ts('When this forward event occurred.'),
130 'required' => TRUE,
131 'where' => 'civicrm_mailing_event_forward.time_stamp',
132 'default' => 'CURRENT_TIMESTAMP',
133 'table_name' => 'civicrm_mailing_event_forward',
134 'entity' => 'Forward',
135 'bao' => 'CRM_Mailing_Event_BAO_Forward',
136 'localizable' => 0,
137 ],
138 ];
139 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
140 }
141 return Civi::$statics[__CLASS__]['fields'];
142 }
143
144 /**
145 * Return a mapping from field-name to the corresponding key (as used in fields()).
146 *
147 * @return array
148 * Array(string $name => string $uniqueName).
149 */
150 public static function &fieldKeys() {
151 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
152 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
153 }
154 return Civi::$statics[__CLASS__]['fieldKeys'];
155 }
156
157 /**
158 * Returns the names of this table
159 *
160 * @return string
161 */
162 public static function getTableName() {
163 return self::$_tableName;
164 }
165
166 /**
167 * Returns if this table needs to be logged
168 *
169 * @return bool
170 */
171 public function getLog() {
172 return self::$_log;
173 }
174
175 /**
176 * Returns the list of fields that can be imported
177 *
178 * @param bool $prefix
179 *
180 * @return array
181 */
182 public static function &import($prefix = FALSE) {
183 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_forward', $prefix, []);
184 return $r;
185 }
186
187 /**
188 * Returns the list of fields that can be exported
189 *
190 * @param bool $prefix
191 *
192 * @return array
193 */
194 public static function &export($prefix = FALSE) {
195 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_forward', $prefix, []);
196 return $r;
197 }
198
199 /**
200 * Returns the list of indices
201 *
202 * @param bool $localize
203 *
204 * @return array
205 */
206 public static function indices($localize = TRUE) {
207 $indices = [];
208 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
209 }
210
211 }