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