5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/Forward.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:60c155254c97ad953fc07b9244440f4e)
13 * Database access object for the Forward entity.
15 class CRM_Mailing_Event_DAO_Forward
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
18 const COMPONENT
= 'CiviMail';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_mailing_event_forward';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
44 public $event_queue_id;
47 * FK to EventQueue for destination
51 public $dest_queue_id;
54 * When this forward event occurred.
63 public function __construct() {
64 $this->__table
= 'civicrm_mailing_event_forward';
65 parent
::__construct();
69 * Returns localized title of this entity.
72 * Whether to return the plural version of the title.
74 public static function getEntityTitle($plural = FALSE) {
75 return $plural ?
ts('Mailing Forwarded Events') : ts('Mailing Forwarded Event');
79 * Returns foreign keys and entity references.
82 * [CRM_Core_Reference_Interface]
84 public static function getReferenceColumns() {
85 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
86 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
87 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
88 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id');
89 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
91 return Civi
::$statics[__CLASS__
]['links'];
95 * Returns all the column names of this table
99 public static function &fields() {
100 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
101 Civi
::$statics[__CLASS__
]['fields'] = [
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Forward ID'),
107 'where' => 'civicrm_mailing_event_forward.id',
108 'table_name' => 'civicrm_mailing_event_forward',
109 'entity' => 'Forward',
110 'bao' => 'CRM_Mailing_Event_BAO_Forward',
118 'event_queue_id' => [
119 'name' => 'event_queue_id',
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Event Queue ID'),
122 'description' => ts('FK to EventQueue'),
124 'where' => 'civicrm_mailing_event_forward.event_queue_id',
125 'table_name' => 'civicrm_mailing_event_forward',
126 'entity' => 'Forward',
127 'bao' => 'CRM_Mailing_Event_BAO_Forward',
129 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
131 'label' => ts("Event Queue"),
136 'name' => 'dest_queue_id',
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('Destination Queue ID'),
139 'description' => ts('FK to EventQueue for destination'),
140 'where' => 'civicrm_mailing_event_forward.dest_queue_id',
141 'table_name' => 'civicrm_mailing_event_forward',
142 'entity' => 'Forward',
143 'bao' => 'CRM_Mailing_Event_BAO_Forward',
145 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
147 'label' => ts("Destination Queue"),
152 'name' => 'time_stamp',
153 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
154 'title' => ts('Timestamp'),
155 'description' => ts('When this forward event occurred.'),
157 'where' => 'civicrm_mailing_event_forward.time_stamp',
158 'default' => 'CURRENT_TIMESTAMP',
159 'table_name' => 'civicrm_mailing_event_forward',
160 'entity' => 'Forward',
161 'bao' => 'CRM_Mailing_Event_BAO_Forward',
166 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
168 return Civi
::$statics[__CLASS__
]['fields'];
172 * Return a mapping from field-name to the corresponding key (as used in fields()).
175 * Array(string $name => string $uniqueName).
177 public static function &fieldKeys() {
178 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
179 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
181 return Civi
::$statics[__CLASS__
]['fieldKeys'];
185 * Returns the names of this table
189 public static function getTableName() {
190 return self
::$_tableName;
194 * Returns if this table needs to be logged
198 public function getLog() {
203 * Returns the list of fields that can be imported
205 * @param bool $prefix
209 public static function &import($prefix = FALSE) {
210 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_forward', $prefix, []);
215 * Returns the list of fields that can be exported
217 * @param bool $prefix
221 public static function &export($prefix = FALSE) {
222 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_forward', $prefix, []);
227 * Returns the list of indices
229 * @param bool $localize
233 public static function indices($localize = TRUE) {
235 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;