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:4fc0787d204ec05deef20a6b3f3f0de0)
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;
35 * @var int|string|null
36 * (SQL type: int unsigned)
37 * Note that values will be retrieved from the database as a string.
45 * (SQL type: int unsigned)
46 * Note that values will be retrieved from the database as a string.
48 public $event_queue_id;
51 * FK to EventQueue for destination
53 * @var int|string|null
54 * (SQL type: int unsigned)
55 * Note that values will be retrieved from the database as a string.
57 public $dest_queue_id;
60 * When this forward event occurred.
63 * (SQL type: timestamp)
64 * Note that values will be retrieved from the database as a string.
71 public function __construct() {
72 $this->__table
= 'civicrm_mailing_event_forward';
73 parent
::__construct();
77 * Returns localized title of this entity.
80 * Whether to return the plural version of the title.
82 public static function getEntityTitle($plural = FALSE) {
83 return $plural ?
ts('Mailing Forwarded Events') : ts('Mailing Forwarded Event');
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
96 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dest_queue_id', 'civicrm_mailing_event_queue', 'id');
97 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
99 return Civi
::$statics[__CLASS__
]['links'];
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Forward ID'),
115 'where' => 'civicrm_mailing_event_forward.id',
116 'table_name' => 'civicrm_mailing_event_forward',
117 'entity' => 'Forward',
118 'bao' => 'CRM_Mailing_Event_BAO_Forward',
126 'event_queue_id' => [
127 'name' => 'event_queue_id',
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('Event Queue ID'),
130 'description' => ts('FK to EventQueue'),
132 'where' => 'civicrm_mailing_event_forward.event_queue_id',
133 'table_name' => 'civicrm_mailing_event_forward',
134 'entity' => 'Forward',
135 'bao' => 'CRM_Mailing_Event_BAO_Forward',
137 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
139 'label' => ts("Event Queue"),
144 'name' => 'dest_queue_id',
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('Destination Queue ID'),
147 'description' => ts('FK to EventQueue for destination'),
148 'where' => 'civicrm_mailing_event_forward.dest_queue_id',
149 'table_name' => 'civicrm_mailing_event_forward',
150 'entity' => 'Forward',
151 'bao' => 'CRM_Mailing_Event_BAO_Forward',
153 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
155 'label' => ts("Destination Queue"),
160 'name' => 'time_stamp',
161 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
162 'title' => ts('Timestamp'),
163 'description' => ts('When this forward event occurred.'),
165 'where' => 'civicrm_mailing_event_forward.time_stamp',
166 'default' => 'CURRENT_TIMESTAMP',
167 'table_name' => 'civicrm_mailing_event_forward',
168 'entity' => 'Forward',
169 'bao' => 'CRM_Mailing_Event_BAO_Forward',
174 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
176 return Civi
::$statics[__CLASS__
]['fields'];
180 * Return a mapping from field-name to the corresponding key (as used in fields()).
183 * Array(string $name => string $uniqueName).
185 public static function &fieldKeys() {
186 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
187 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
189 return Civi
::$statics[__CLASS__
]['fieldKeys'];
193 * Returns the names of this table
197 public static function getTableName() {
198 return self
::$_tableName;
202 * Returns if this table needs to be logged
206 public function getLog() {
211 * Returns the list of fields that can be imported
213 * @param bool $prefix
217 public static function &import($prefix = FALSE) {
218 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_forward', $prefix, []);
223 * Returns the list of fields that can be exported
225 * @param bool $prefix
229 public static function &export($prefix = FALSE) {
230 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_forward', $prefix, []);
235 * Returns the list of indices
237 * @param bool $localize
241 public static function indices($localize = TRUE) {
243 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;