Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Mailing/Event/Forward.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
929a1c14 | 9 | * (GenCodeChecksum:359e0b700860c29a1e809fd4acbf7598) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Forward entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Mailing_Event_DAO_Forward extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = ''; | |
c3fc2621 | 18 | |
e501603b | 19 | /** |
f41f0342 | 20 | * Static instance to hold the table name. |
e501603b TO |
21 | * |
22 | * @var string | |
23 | */ | |
fa45b5b9 | 24 | public static $_tableName = 'civicrm_mailing_event_forward'; |
c3fc2621 | 25 | |
e501603b | 26 | /** |
f41f0342 | 27 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 28 | * |
c3fc2621 | 29 | * @var bool |
e501603b | 30 | */ |
fa45b5b9 | 31 | public static $_log = FALSE; |
c3fc2621 | 32 | |
e501603b | 33 | /** |
e6ca0a57 | 34 | * @var int |
e501603b TO |
35 | */ |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * FK to EventQueue | |
40 | * | |
e6ca0a57 | 41 | * @var int |
e501603b TO |
42 | */ |
43 | public $event_queue_id; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * FK to EventQueue for destination | |
47 | * | |
e6ca0a57 | 48 | * @var int |
e501603b TO |
49 | */ |
50 | public $dest_queue_id; | |
c3fc2621 | 51 | |
e501603b TO |
52 | /** |
53 | * When this forward event occurred. | |
54 | * | |
6c2b97b7 | 55 | * @var timestamp |
e501603b TO |
56 | */ |
57 | public $time_stamp; | |
c3fc2621 | 58 | |
e501603b | 59 | /** |
f41f0342 | 60 | * Class constructor. |
e501603b | 61 | */ |
c3fc2621 | 62 | public function __construct() { |
e501603b TO |
63 | $this->__table = 'civicrm_mailing_event_forward'; |
64 | parent::__construct(); | |
65 | } | |
c3fc2621 | 66 | |
449c4e6b CW |
67 | /** |
68 | * Returns localized title of this entity. | |
69 | */ | |
70 | public static function getEntityTitle() { | |
71 | return ts('Forwards'); | |
72 | } | |
73 | ||
e501603b | 74 | /** |
f41f0342 | 75 | * Returns foreign keys and entity references. |
e501603b TO |
76 | * |
77 | * @return array | |
78 | * [CRM_Core_Reference_Interface] | |
79 | */ | |
c3fc2621 | 80 | public static function getReferenceColumns() { |
346aaaba | 81 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
a36434b9 | 82 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
83 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); |
84 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id'); | |
346aaaba | 85 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 86 | } |
346aaaba | 87 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 88 | } |
c3fc2621 | 89 | |
e501603b TO |
90 | /** |
91 | * Returns all the column names of this table | |
92 | * | |
93 | * @return array | |
94 | */ | |
c3fc2621 | 95 | public static function &fields() { |
346aaaba | 96 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
97 | Civi::$statics[__CLASS__]['fields'] = [ |
98 | 'id' => [ | |
e501603b TO |
99 | 'name' => 'id', |
100 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
101 | 'title' => ts('Forward ID'), |
102 | 'required' => TRUE, | |
a36434b9 | 103 | 'where' => 'civicrm_mailing_event_forward.id', |
522a26c9 | 104 | 'table_name' => 'civicrm_mailing_event_forward', |
105 | 'entity' => 'Forward', | |
106 | 'bao' => 'CRM_Mailing_Event_BAO_Forward', | |
6a7e5e5d | 107 | 'localizable' => 0, |
a9d0587b | 108 | 'add' => NULL, |
c3fc2621 CW |
109 | ], |
110 | 'event_queue_id' => [ | |
e501603b TO |
111 | 'name' => 'event_queue_id', |
112 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 113 | 'title' => ts('Mailing Event Queue'), |
215b423e | 114 | 'description' => ts('FK to EventQueue'), |
c3fc2621 | 115 | 'required' => TRUE, |
a36434b9 | 116 | 'where' => 'civicrm_mailing_event_forward.event_queue_id', |
522a26c9 | 117 | 'table_name' => 'civicrm_mailing_event_forward', |
118 | 'entity' => 'Forward', | |
119 | 'bao' => 'CRM_Mailing_Event_BAO_Forward', | |
6a7e5e5d | 120 | 'localizable' => 0, |
e501603b | 121 | 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', |
a9d0587b | 122 | 'add' => NULL, |
c3fc2621 CW |
123 | ], |
124 | 'dest_queue_id' => [ | |
e501603b TO |
125 | 'name' => 'dest_queue_id', |
126 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 127 | 'title' => ts('Destination Queue'), |
215b423e | 128 | 'description' => ts('FK to EventQueue for destination'), |
a36434b9 | 129 | 'where' => 'civicrm_mailing_event_forward.dest_queue_id', |
522a26c9 | 130 | 'table_name' => 'civicrm_mailing_event_forward', |
131 | 'entity' => 'Forward', | |
132 | 'bao' => 'CRM_Mailing_Event_BAO_Forward', | |
6a7e5e5d | 133 | 'localizable' => 0, |
e501603b | 134 | 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', |
a9d0587b | 135 | 'add' => NULL, |
c3fc2621 CW |
136 | ], |
137 | 'time_stamp' => [ | |
e501603b | 138 | 'name' => 'time_stamp', |
6c2b97b7 | 139 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
c3fc2621 | 140 | 'title' => ts('Timestamp'), |
215b423e | 141 | 'description' => ts('When this forward event occurred.'), |
c3fc2621 | 142 | 'required' => TRUE, |
a36434b9 | 143 | 'where' => 'civicrm_mailing_event_forward.time_stamp', |
6c2b97b7 | 144 | 'default' => 'CURRENT_TIMESTAMP', |
522a26c9 | 145 | 'table_name' => 'civicrm_mailing_event_forward', |
146 | 'entity' => 'Forward', | |
147 | 'bao' => 'CRM_Mailing_Event_BAO_Forward', | |
6a7e5e5d | 148 | 'localizable' => 0, |
a9d0587b | 149 | 'add' => NULL, |
c3fc2621 CW |
150 | ], |
151 | ]; | |
346aaaba | 152 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 153 | } |
346aaaba | 154 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 155 | } |
c3fc2621 | 156 | |
e501603b | 157 | /** |
bd8e0b14 | 158 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
159 | * |
160 | * @return array | |
bd8e0b14 | 161 | * Array(string $name => string $uniqueName). |
e501603b | 162 | */ |
c3fc2621 | 163 | public static function &fieldKeys() { |
bd8e0b14 TO |
164 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
165 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 166 | } |
bd8e0b14 | 167 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 168 | } |
c3fc2621 | 169 | |
e501603b TO |
170 | /** |
171 | * Returns the names of this table | |
172 | * | |
173 | * @return string | |
174 | */ | |
c3fc2621 | 175 | public static function getTableName() { |
e501603b TO |
176 | return self::$_tableName; |
177 | } | |
c3fc2621 | 178 | |
e501603b TO |
179 | /** |
180 | * Returns if this table needs to be logged | |
181 | * | |
c3fc2621 | 182 | * @return bool |
e501603b | 183 | */ |
c3fc2621 | 184 | public function getLog() { |
e501603b TO |
185 | return self::$_log; |
186 | } | |
c3fc2621 | 187 | |
e501603b TO |
188 | /** |
189 | * Returns the list of fields that can be imported | |
190 | * | |
191 | * @param bool $prefix | |
192 | * | |
193 | * @return array | |
194 | */ | |
c3fc2621 CW |
195 | public static function &import($prefix = FALSE) { |
196 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_forward', $prefix, []); | |
60808919 | 197 | return $r; |
e501603b | 198 | } |
c3fc2621 | 199 | |
e501603b TO |
200 | /** |
201 | * Returns the list of fields that can be exported | |
202 | * | |
203 | * @param bool $prefix | |
204 | * | |
205 | * @return array | |
206 | */ | |
c3fc2621 CW |
207 | public static function &export($prefix = FALSE) { |
208 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_forward', $prefix, []); | |
60808919 | 209 | return $r; |
e501603b | 210 | } |
c3fc2621 | 211 | |
e7a6b91a AS |
212 | /** |
213 | * Returns the list of indices | |
c3fc2621 CW |
214 | * |
215 | * @param bool $localize | |
216 | * | |
217 | * @return array | |
e7a6b91a AS |
218 | */ |
219 | public static function indices($localize = TRUE) { | |
c3fc2621 | 220 | $indices = []; |
e7a6b91a AS |
221 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
222 | } | |
c3fc2621 | 223 | |
e501603b | 224 | } |