API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[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:a8246c6739f95a8e25d17ddebe882db7)
10 */
11
12 /**
13 * Database access object for the Reply entity.
14 */
15 class 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 'add' => NULL,
99 ],
100 'event_queue_id' => [
101 'name' => 'event_queue_id',
102 'type' => CRM_Utils_Type::T_INT,
103 'title' => ts('Event Queue'),
104 'description' => ts('FK to EventQueue'),
105 'required' => TRUE,
106 'where' => 'civicrm_mailing_event_reply.event_queue_id',
107 'table_name' => 'civicrm_mailing_event_reply',
108 'entity' => 'Reply',
109 'bao' => 'CRM_Mailing_Event_BAO_Reply',
110 'localizable' => 0,
111 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
112 'add' => NULL,
113 ],
114 'time_stamp' => [
115 'name' => 'time_stamp',
116 'type' => CRM_Utils_Type::T_TIMESTAMP,
117 'title' => ts('Reply Timestamp'),
118 'description' => ts('When this reply event occurred.'),
119 'required' => TRUE,
120 'where' => 'civicrm_mailing_event_reply.time_stamp',
121 'default' => 'CURRENT_TIMESTAMP',
122 'table_name' => 'civicrm_mailing_event_reply',
123 'entity' => 'Reply',
124 'bao' => 'CRM_Mailing_Event_BAO_Reply',
125 'localizable' => 0,
126 'add' => NULL,
127 ],
128 ];
129 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
130 }
131 return Civi::$statics[__CLASS__]['fields'];
132 }
133
134 /**
135 * Return a mapping from field-name to the corresponding key (as used in fields()).
136 *
137 * @return array
138 * Array(string $name => string $uniqueName).
139 */
140 public static function &fieldKeys() {
141 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
142 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
143 }
144 return Civi::$statics[__CLASS__]['fieldKeys'];
145 }
146
147 /**
148 * Returns the names of this table
149 *
150 * @return string
151 */
152 public static function getTableName() {
153 return self::$_tableName;
154 }
155
156 /**
157 * Returns if this table needs to be logged
158 *
159 * @return bool
160 */
161 public function getLog() {
162 return self::$_log;
163 }
164
165 /**
166 * Returns the list of fields that can be imported
167 *
168 * @param bool $prefix
169 *
170 * @return array
171 */
172 public static function &import($prefix = FALSE) {
173 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_reply', $prefix, []);
174 return $r;
175 }
176
177 /**
178 * Returns the list of fields that can be exported
179 *
180 * @param bool $prefix
181 *
182 * @return array
183 */
184 public static function &export($prefix = FALSE) {
185 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_reply', $prefix, []);
186 return $r;
187 }
188
189 /**
190 * Returns the list of indices
191 *
192 * @param bool $localize
193 *
194 * @return array
195 */
196 public static function indices($localize = TRUE) {
197 $indices = [];
198 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
199 }
200
201 }