Merge pull request #23274 from civicrm/5.49
[civicrm-core.git] / CRM / Mailing / Event / DAO / Reply.php
CommitLineData
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
28979d65 9 * (GenCodeChecksum:530a4b8ec0e37cbd23bf0acf8be67181)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Reply entity.
f41f0342 14 */
e501603b 15class 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 /**
28979d65
CW
35 * @var int|string|null
36 * (SQL type: int unsigned)
37 * Note that values will be retrieved from the database as a string.
e501603b
TO
38 */
39 public $id;
c3fc2621 40
e501603b
TO
41 /**
42 * FK to EventQueue
43 *
28979d65
CW
44 * @var int|string
45 * (SQL type: int unsigned)
46 * Note that values will be retrieved from the database as a string.
e501603b
TO
47 */
48 public $event_queue_id;
c3fc2621 49
e501603b
TO
50 /**
51 * When this reply event occurred.
52 *
28979d65
CW
53 * @var string
54 * (SQL type: timestamp)
55 * Note that values will be retrieved from the database as a string.
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_reply';
64 parent::__construct();
65 }
449c4e6b
CW
66
67 /**
68 * Returns localized title of this entity.
7b66c3b5
AH
69 *
70 * @param bool $plural
71 * Whether to return the plural version of the title.
449c4e6b 72 */
7b66c3b5
AH
73 public static function getEntityTitle($plural = FALSE) {
74 return $plural ? ts('Replies') : ts('Reply');
449c4e6b 75 }
c3fc2621 76
e501603b 77 /**
f41f0342 78 * Returns foreign keys and entity references.
e501603b
TO
79 *
80 * @return array
81 * [CRM_Core_Reference_Interface]
82 */
c3fc2621 83 public static function getReferenceColumns() {
346aaaba 84 if (!isset(Civi::$statics[__CLASS__]['links'])) {
a36434b9 85 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621 86 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
346aaaba 87 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 88 }
346aaaba 89 return Civi::$statics[__CLASS__]['links'];
e501603b 90 }
c3fc2621 91
e501603b
TO
92 /**
93 * Returns all the column names of this table
94 *
95 * @return array
96 */
c3fc2621 97 public static function &fields() {
346aaaba 98 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
99 Civi::$statics[__CLASS__]['fields'] = [
100 'id' => [
e501603b
TO
101 'name' => 'id',
102 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
103 'title' => ts('Reply ID'),
104 'required' => TRUE,
a36434b9 105 'where' => 'civicrm_mailing_event_reply.id',
522a26c9 106 'table_name' => 'civicrm_mailing_event_reply',
107 'entity' => 'Reply',
108 'bao' => 'CRM_Mailing_Event_BAO_Reply',
6a7e5e5d 109 'localizable' => 0,
2cbbebe8
A
110 'html' => [
111 'type' => 'Number',
112 ],
1fe423d6 113 'readonly' => TRUE,
a9d0587b 114 'add' => NULL,
c3fc2621
CW
115 ],
116 'event_queue_id' => [
e501603b
TO
117 'name' => 'event_queue_id',
118 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 119 'title' => ts('Event Queue ID'),
215b423e 120 'description' => ts('FK to EventQueue'),
c3fc2621 121 'required' => TRUE,
a36434b9 122 'where' => 'civicrm_mailing_event_reply.event_queue_id',
522a26c9 123 'table_name' => 'civicrm_mailing_event_reply',
124 'entity' => 'Reply',
125 'bao' => 'CRM_Mailing_Event_BAO_Reply',
6a7e5e5d 126 'localizable' => 0,
e501603b 127 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
2cbbebe8
A
128 'html' => [
129 'label' => ts("Event Queue"),
130 ],
a9d0587b 131 'add' => NULL,
c3fc2621
CW
132 ],
133 'time_stamp' => [
e501603b 134 'name' => 'time_stamp',
6c2b97b7 135 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 136 'title' => ts('Reply Timestamp'),
215b423e 137 'description' => ts('When this reply event occurred.'),
c3fc2621 138 'required' => TRUE,
a36434b9 139 'where' => 'civicrm_mailing_event_reply.time_stamp',
6c2b97b7 140 'default' => 'CURRENT_TIMESTAMP',
522a26c9 141 'table_name' => 'civicrm_mailing_event_reply',
142 'entity' => 'Reply',
143 'bao' => 'CRM_Mailing_Event_BAO_Reply',
6a7e5e5d 144 'localizable' => 0,
a9d0587b 145 'add' => NULL,
c3fc2621
CW
146 ],
147 ];
346aaaba 148 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 149 }
346aaaba 150 return Civi::$statics[__CLASS__]['fields'];
e501603b 151 }
c3fc2621 152
e501603b 153 /**
bd8e0b14 154 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
155 *
156 * @return array
bd8e0b14 157 * Array(string $name => string $uniqueName).
e501603b 158 */
c3fc2621 159 public static function &fieldKeys() {
bd8e0b14
TO
160 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
161 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 162 }
bd8e0b14 163 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 164 }
c3fc2621 165
e501603b
TO
166 /**
167 * Returns the names of this table
168 *
169 * @return string
170 */
c3fc2621 171 public static function getTableName() {
e501603b
TO
172 return self::$_tableName;
173 }
c3fc2621 174
e501603b
TO
175 /**
176 * Returns if this table needs to be logged
177 *
c3fc2621 178 * @return bool
e501603b 179 */
c3fc2621 180 public function getLog() {
e501603b
TO
181 return self::$_log;
182 }
c3fc2621 183
e501603b
TO
184 /**
185 * Returns the list of fields that can be imported
186 *
187 * @param bool $prefix
188 *
189 * @return array
190 */
c3fc2621
CW
191 public static function &import($prefix = FALSE) {
192 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_reply', $prefix, []);
60808919 193 return $r;
e501603b 194 }
c3fc2621 195
e501603b
TO
196 /**
197 * Returns the list of fields that can be exported
198 *
199 * @param bool $prefix
200 *
201 * @return array
202 */
c3fc2621
CW
203 public static function &export($prefix = FALSE) {
204 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_reply', $prefix, []);
60808919 205 return $r;
e501603b 206 }
c3fc2621 207
e7a6b91a
AS
208 /**
209 * Returns the list of indices
c3fc2621
CW
210 *
211 * @param bool $localize
212 *
213 * @return array
e7a6b91a
AS
214 */
215 public static function indices($localize = TRUE) {
c3fc2621 216 $indices = [];
e7a6b91a
AS
217 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
218 }
c3fc2621 219
e501603b 220}