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/Reply.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
d31fb4e3 | 9 | * (GenCodeChecksum:2efc7b66635682132414c6724344bf55) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Reply entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Mailing_Event_DAO_Reply extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = ''; | |
d31fb4e3 | 18 | const COMPONENT = 'CiviMail'; |
c3fc2621 | 19 | |
e501603b | 20 | /** |
f41f0342 | 21 | * Static instance to hold the table name. |
e501603b TO |
22 | * |
23 | * @var string | |
24 | */ | |
fa45b5b9 | 25 | public static $_tableName = 'civicrm_mailing_event_reply'; |
c3fc2621 | 26 | |
e501603b | 27 | /** |
f41f0342 | 28 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 29 | * |
c3fc2621 | 30 | * @var bool |
e501603b | 31 | */ |
fa45b5b9 | 32 | public static $_log = FALSE; |
c3fc2621 | 33 | |
e501603b | 34 | /** |
e6ca0a57 | 35 | * @var int |
e501603b TO |
36 | */ |
37 | public $id; | |
c3fc2621 | 38 | |
e501603b TO |
39 | /** |
40 | * FK to EventQueue | |
41 | * | |
e6ca0a57 | 42 | * @var int |
e501603b TO |
43 | */ |
44 | public $event_queue_id; | |
c3fc2621 | 45 | |
e501603b TO |
46 | /** |
47 | * When this reply event occurred. | |
48 | * | |
6c2b97b7 | 49 | * @var timestamp |
e501603b TO |
50 | */ |
51 | public $time_stamp; | |
c3fc2621 | 52 | |
e501603b | 53 | /** |
f41f0342 | 54 | * Class constructor. |
e501603b | 55 | */ |
c3fc2621 | 56 | public function __construct() { |
e501603b TO |
57 | $this->__table = 'civicrm_mailing_event_reply'; |
58 | parent::__construct(); | |
59 | } | |
449c4e6b CW |
60 | |
61 | /** | |
62 | * Returns localized title of this entity. | |
7b66c3b5 AH |
63 | * |
64 | * @param bool $plural | |
65 | * Whether to return the plural version of the title. | |
449c4e6b | 66 | */ |
7b66c3b5 AH |
67 | public static function getEntityTitle($plural = FALSE) { |
68 | return $plural ? ts('Replies') : ts('Reply'); | |
449c4e6b | 69 | } |
c3fc2621 | 70 | |
e501603b | 71 | /** |
f41f0342 | 72 | * Returns foreign keys and entity references. |
e501603b TO |
73 | * |
74 | * @return array | |
75 | * [CRM_Core_Reference_Interface] | |
76 | */ | |
c3fc2621 | 77 | public static function getReferenceColumns() { |
346aaaba | 78 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
a36434b9 | 79 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 | 80 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); |
346aaaba | 81 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 82 | } |
346aaaba | 83 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 84 | } |
c3fc2621 | 85 | |
e501603b TO |
86 | /** |
87 | * Returns all the column names of this table | |
88 | * | |
89 | * @return array | |
90 | */ | |
c3fc2621 | 91 | public static function &fields() { |
346aaaba | 92 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
93 | Civi::$statics[__CLASS__]['fields'] = [ |
94 | 'id' => [ | |
e501603b TO |
95 | 'name' => 'id', |
96 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
97 | 'title' => ts('Reply ID'), |
98 | 'required' => TRUE, | |
a36434b9 | 99 | 'where' => 'civicrm_mailing_event_reply.id', |
522a26c9 | 100 | 'table_name' => 'civicrm_mailing_event_reply', |
101 | 'entity' => 'Reply', | |
102 | 'bao' => 'CRM_Mailing_Event_BAO_Reply', | |
6a7e5e5d | 103 | 'localizable' => 0, |
a9d0587b | 104 | 'add' => NULL, |
c3fc2621 CW |
105 | ], |
106 | 'event_queue_id' => [ | |
e501603b TO |
107 | 'name' => 'event_queue_id', |
108 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 109 | 'title' => ts('Event Queue'), |
215b423e | 110 | 'description' => ts('FK to EventQueue'), |
c3fc2621 | 111 | 'required' => TRUE, |
a36434b9 | 112 | 'where' => 'civicrm_mailing_event_reply.event_queue_id', |
522a26c9 | 113 | 'table_name' => 'civicrm_mailing_event_reply', |
114 | 'entity' => 'Reply', | |
115 | 'bao' => 'CRM_Mailing_Event_BAO_Reply', | |
6a7e5e5d | 116 | 'localizable' => 0, |
e501603b | 117 | 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', |
a9d0587b | 118 | 'add' => NULL, |
c3fc2621 CW |
119 | ], |
120 | 'time_stamp' => [ | |
e501603b | 121 | 'name' => 'time_stamp', |
6c2b97b7 | 122 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
c3fc2621 | 123 | 'title' => ts('Reply Timestamp'), |
215b423e | 124 | 'description' => ts('When this reply event occurred.'), |
c3fc2621 | 125 | 'required' => TRUE, |
a36434b9 | 126 | 'where' => 'civicrm_mailing_event_reply.time_stamp', |
6c2b97b7 | 127 | 'default' => 'CURRENT_TIMESTAMP', |
522a26c9 | 128 | 'table_name' => 'civicrm_mailing_event_reply', |
129 | 'entity' => 'Reply', | |
130 | 'bao' => 'CRM_Mailing_Event_BAO_Reply', | |
6a7e5e5d | 131 | 'localizable' => 0, |
a9d0587b | 132 | 'add' => NULL, |
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_reply', $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_reply', $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 | } |