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:ea0e4a784e682347d7320337cb5bc1ac)
13 * Database access object for the Forward entity.
15 class CRM_Mailing_Event_DAO_Forward
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing_event_forward';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
41 public $event_queue_id;
44 * FK to EventQueue for destination
48 public $dest_queue_id;
51 * When this forward event occurred.
60 public function __construct() {
61 $this->__table
= 'civicrm_mailing_event_forward';
62 parent
::__construct();
66 * Returns localized title of this entity.
68 public static function getEntityTitle() {
69 return ts('Forwards');
73 * Returns foreign keys and entity references.
76 * [CRM_Core_Reference_Interface]
78 public static function getReferenceColumns() {
79 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
80 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
81 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
82 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id');
83 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
85 return Civi
::$statics[__CLASS__
]['links'];
89 * Returns all the column names of this table
93 public static function &fields() {
94 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
95 Civi
::$statics[__CLASS__
]['fields'] = [
98 'type' => CRM_Utils_Type
::T_INT
,
99 'title' => ts('Forward ID'),
101 'where' => 'civicrm_mailing_event_forward.id',
102 'table_name' => 'civicrm_mailing_event_forward',
103 'entity' => 'Forward',
104 'bao' => 'CRM_Mailing_Event_BAO_Forward',
108 'event_queue_id' => [
109 'name' => 'event_queue_id',
110 'type' => CRM_Utils_Type
::T_INT
,
111 'title' => ts('Mailing Event Queue'),
112 'description' => ts('FK to EventQueue'),
114 'where' => 'civicrm_mailing_event_forward.event_queue_id',
115 'table_name' => 'civicrm_mailing_event_forward',
116 'entity' => 'Forward',
117 'bao' => 'CRM_Mailing_Event_BAO_Forward',
119 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
123 'name' => 'dest_queue_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Destination Queue'),
126 'description' => ts('FK to EventQueue for destination'),
127 'where' => 'civicrm_mailing_event_forward.dest_queue_id',
128 'table_name' => 'civicrm_mailing_event_forward',
129 'entity' => 'Forward',
130 'bao' => 'CRM_Mailing_Event_BAO_Forward',
132 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
136 'name' => 'time_stamp',
137 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
138 'title' => ts('Timestamp'),
139 'description' => ts('When this forward event occurred.'),
141 'where' => 'civicrm_mailing_event_forward.time_stamp',
142 'default' => 'CURRENT_TIMESTAMP',
143 'table_name' => 'civicrm_mailing_event_forward',
144 'entity' => 'Forward',
145 'bao' => 'CRM_Mailing_Event_BAO_Forward',
150 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
152 return Civi
::$statics[__CLASS__
]['fields'];
156 * Return a mapping from field-name to the corresponding key (as used in fields()).
159 * Array(string $name => string $uniqueName).
161 public static function &fieldKeys() {
162 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
163 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
165 return Civi
::$statics[__CLASS__
]['fieldKeys'];
169 * Returns the names of this table
173 public static function getTableName() {
174 return self
::$_tableName;
178 * Returns if this table needs to be logged
182 public function getLog() {
187 * Returns the list of fields that can be imported
189 * @param bool $prefix
193 public static function &import($prefix = FALSE) {
194 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_forward', $prefix, []);
199 * Returns the list of fields that can be exported
201 * @param bool $prefix
205 public static function &export($prefix = FALSE) {
206 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_forward', $prefix, []);
211 * Returns the list of indices
213 * @param bool $localize
217 public static function indices($localize = TRUE) {
219 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;