5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/Event/Forward.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:73d4b00ff9ea00d604d5e83963ba5597)
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 static $_tableName = 'civicrm_mailing_event_forward';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 foreign keys and entity references.
69 * [CRM_Core_Reference_Interface]
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 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id');
76 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
78 return Civi
::$statics[__CLASS__
]['links'];
82 * Returns all the column names of this table
86 public static function &fields() {
87 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
88 Civi
::$statics[__CLASS__
]['fields'] = [
91 'type' => CRM_Utils_Type
::T_INT
,
92 'title' => ts('Forward ID'),
94 'table_name' => 'civicrm_mailing_event_forward',
95 'entity' => 'Forward',
96 'bao' => 'CRM_Mailing_Event_BAO_Forward',
100 'name' => 'event_queue_id',
101 'type' => CRM_Utils_Type
::T_INT
,
102 'title' => ts('Mailing Event Queue'),
103 'description' => ts('FK to EventQueue'),
105 'table_name' => 'civicrm_mailing_event_forward',
106 'entity' => 'Forward',
107 'bao' => 'CRM_Mailing_Event_BAO_Forward',
109 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
112 'name' => 'dest_queue_id',
113 'type' => CRM_Utils_Type
::T_INT
,
114 'title' => ts('Destination Queue'),
115 'description' => ts('FK to EventQueue for destination'),
116 'table_name' => 'civicrm_mailing_event_forward',
117 'entity' => 'Forward',
118 'bao' => 'CRM_Mailing_Event_BAO_Forward',
120 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
123 'name' => 'time_stamp',
124 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
125 'title' => ts('Timestamp'),
126 'description' => ts('When this forward event occurred.'),
128 'default' => 'CURRENT_TIMESTAMP',
129 'table_name' => 'civicrm_mailing_event_forward',
130 'entity' => 'Forward',
131 'bao' => 'CRM_Mailing_Event_BAO_Forward',
135 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
137 return Civi
::$statics[__CLASS__
]['fields'];
141 * Return a mapping from field-name to the corresponding key (as used in fields()).
144 * Array(string $name => string $uniqueName).
146 public static function &fieldKeys() {
147 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
148 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
150 return Civi
::$statics[__CLASS__
]['fieldKeys'];
154 * Returns the names of this table
158 public static function getTableName() {
159 return self
::$_tableName;
163 * Returns if this table needs to be logged
167 public function getLog() {
172 * Returns the list of fields that can be imported
174 * @param bool $prefix
178 public static function &import($prefix = FALSE) {
179 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_forward', $prefix, []);
184 * Returns the list of fields that can be exported
186 * @param bool $prefix
190 public static function &export($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_forward', $prefix, []);
196 * Returns the list of indices
198 * @param bool $localize
202 public static function indices($localize = TRUE) {
204 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;