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