Add @searchable annotation to denote which API entities should be visible in Search...
[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
828c6915 9 * (GenCodeChecksum:09d539a90e11ec1cb333d10900eaba88)
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 = '';
c3fc2621 18
e501603b 19 /**
f41f0342 20 * Static instance to hold the table name.
e501603b
TO
21 *
22 * @var string
23 */
fa45b5b9 24 public static $_tableName = 'civicrm_mailing_event_reply';
c3fc2621 25
e501603b 26 /**
f41f0342 27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 28 *
c3fc2621 29 * @var bool
e501603b 30 */
fa45b5b9 31 public static $_log = FALSE;
c3fc2621 32
e501603b 33 /**
e6ca0a57 34 * @var int
e501603b
TO
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * FK to EventQueue
40 *
e6ca0a57 41 * @var int
e501603b
TO
42 */
43 public $event_queue_id;
c3fc2621 44
e501603b
TO
45 /**
46 * When this reply event occurred.
47 *
6c2b97b7 48 * @var timestamp
e501603b
TO
49 */
50 public $time_stamp;
c3fc2621 51
e501603b 52 /**
f41f0342 53 * Class constructor.
e501603b 54 */
c3fc2621 55 public function __construct() {
e501603b
TO
56 $this->__table = 'civicrm_mailing_event_reply';
57 parent::__construct();
58 }
449c4e6b
CW
59
60 /**
61 * Returns localized title of this entity.
7b66c3b5
AH
62 *
63 * @param bool $plural
64 * Whether to return the plural version of the title.
449c4e6b 65 */
7b66c3b5
AH
66 public static function getEntityTitle($plural = FALSE) {
67 return $plural ? ts('Replies') : ts('Reply');
449c4e6b 68 }
c3fc2621 69
e501603b 70 /**
f41f0342 71 * Returns foreign keys and entity references.
e501603b
TO
72 *
73 * @return array
74 * [CRM_Core_Reference_Interface]
75 */
c3fc2621 76 public static function getReferenceColumns() {
346aaaba 77 if (!isset(Civi::$statics[__CLASS__]['links'])) {
a36434b9 78 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621 79 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
346aaaba 80 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 81 }
346aaaba 82 return Civi::$statics[__CLASS__]['links'];
e501603b 83 }
c3fc2621 84
e501603b
TO
85 /**
86 * Returns all the column names of this table
87 *
88 * @return array
89 */
c3fc2621 90 public static function &fields() {
346aaaba 91 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
92 Civi::$statics[__CLASS__]['fields'] = [
93 'id' => [
e501603b
TO
94 'name' => 'id',
95 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
96 'title' => ts('Reply ID'),
97 'required' => TRUE,
a36434b9 98 'where' => 'civicrm_mailing_event_reply.id',
522a26c9 99 'table_name' => 'civicrm_mailing_event_reply',
100 'entity' => 'Reply',
101 'bao' => 'CRM_Mailing_Event_BAO_Reply',
6a7e5e5d 102 'localizable' => 0,
a9d0587b 103 'add' => NULL,
c3fc2621
CW
104 ],
105 'event_queue_id' => [
e501603b
TO
106 'name' => 'event_queue_id',
107 'type' => CRM_Utils_Type::T_INT,
c3fc2621 108 'title' => ts('Event Queue'),
215b423e 109 'description' => ts('FK to EventQueue'),
c3fc2621 110 'required' => TRUE,
a36434b9 111 'where' => 'civicrm_mailing_event_reply.event_queue_id',
522a26c9 112 'table_name' => 'civicrm_mailing_event_reply',
113 'entity' => 'Reply',
114 'bao' => 'CRM_Mailing_Event_BAO_Reply',
6a7e5e5d 115 'localizable' => 0,
e501603b 116 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
a9d0587b 117 'add' => NULL,
c3fc2621
CW
118 ],
119 'time_stamp' => [
e501603b 120 'name' => 'time_stamp',
6c2b97b7 121 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 122 'title' => ts('Reply Timestamp'),
215b423e 123 'description' => ts('When this reply event occurred.'),
c3fc2621 124 'required' => TRUE,
a36434b9 125 'where' => 'civicrm_mailing_event_reply.time_stamp',
6c2b97b7 126 'default' => 'CURRENT_TIMESTAMP',
522a26c9 127 'table_name' => 'civicrm_mailing_event_reply',
128 'entity' => 'Reply',
129 'bao' => 'CRM_Mailing_Event_BAO_Reply',
6a7e5e5d 130 'localizable' => 0,
a9d0587b 131 'add' => NULL,
c3fc2621
CW
132 ],
133 ];
346aaaba 134 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 135 }
346aaaba 136 return Civi::$statics[__CLASS__]['fields'];
e501603b 137 }
c3fc2621 138
e501603b 139 /**
bd8e0b14 140 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
141 *
142 * @return array
bd8e0b14 143 * Array(string $name => string $uniqueName).
e501603b 144 */
c3fc2621 145 public static function &fieldKeys() {
bd8e0b14
TO
146 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
147 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 148 }
bd8e0b14 149 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 150 }
c3fc2621 151
e501603b
TO
152 /**
153 * Returns the names of this table
154 *
155 * @return string
156 */
c3fc2621 157 public static function getTableName() {
e501603b
TO
158 return self::$_tableName;
159 }
c3fc2621 160
e501603b
TO
161 /**
162 * Returns if this table needs to be logged
163 *
c3fc2621 164 * @return bool
e501603b 165 */
c3fc2621 166 public function getLog() {
e501603b
TO
167 return self::$_log;
168 }
c3fc2621 169
e501603b
TO
170 /**
171 * Returns the list of fields that can be imported
172 *
173 * @param bool $prefix
174 *
175 * @return array
176 */
c3fc2621
CW
177 public static function &import($prefix = FALSE) {
178 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_reply', $prefix, []);
60808919 179 return $r;
e501603b 180 }
c3fc2621 181
e501603b
TO
182 /**
183 * Returns the list of fields that can be exported
184 *
185 * @param bool $prefix
186 *
187 * @return array
188 */
c3fc2621
CW
189 public static function &export($prefix = FALSE) {
190 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_reply', $prefix, []);
60808919 191 return $r;
e501603b 192 }
c3fc2621 193
e7a6b91a
AS
194 /**
195 * Returns the list of indices
c3fc2621
CW
196 *
197 * @param bool $localize
198 *
199 * @return array
e7a6b91a
AS
200 */
201 public static function indices($localize = TRUE) {
c3fc2621 202 $indices = [];
e7a6b91a
AS
203 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
204 }
c3fc2621 205
e501603b 206}