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