5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/Event/Unsubscribe.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a44ecc4ce8b1a8ecdca57fff8d053392)
13 * Database access object for the Unsubscribe entity.
15 class CRM_Mailing_Event_DAO_Unsubscribe
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_mailing_event_unsubscribe';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
41 public $event_queue_id;
44 * Unsubscribe at org- or group-level
48 public $org_unsubscribe;
51 * When this delivery event occurred.
60 public function __construct() {
61 $this->__table
= 'civicrm_mailing_event_unsubscribe';
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 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
77 return Civi
::$statics[__CLASS__
]['links'];
81 * Returns all the column names of this table
85 public static function &fields() {
86 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
87 Civi
::$statics[__CLASS__
]['fields'] = [
90 'type' => CRM_Utils_Type
::T_INT
,
91 'title' => ts('Unsubscribe ID'),
93 'table_name' => 'civicrm_mailing_event_unsubscribe',
94 'entity' => 'Unsubscribe',
95 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe',
99 'name' => 'event_queue_id',
100 'type' => CRM_Utils_Type
::T_INT
,
101 'title' => ts('Mailing Event Queue'),
102 'description' => ts('FK to EventQueue'),
104 'table_name' => 'civicrm_mailing_event_unsubscribe',
105 'entity' => 'Unsubscribe',
106 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe',
108 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
110 'org_unsubscribe' => [
111 'name' => 'org_unsubscribe',
112 'type' => CRM_Utils_Type
::T_BOOLEAN
,
113 'title' => ts('Unsubscribe is for Organization?'),
114 'description' => ts('Unsubscribe at org- or group-level'),
116 'table_name' => 'civicrm_mailing_event_unsubscribe',
117 'entity' => 'Unsubscribe',
118 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe',
122 'name' => 'time_stamp',
123 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
124 'title' => ts('Unsubscribe Timestamp'),
125 'description' => ts('When this delivery event occurred.'),
127 'default' => 'CURRENT_TIMESTAMP',
128 'table_name' => 'civicrm_mailing_event_unsubscribe',
129 'entity' => 'Unsubscribe',
130 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe',
134 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
136 return Civi
::$statics[__CLASS__
]['fields'];
140 * Return a mapping from field-name to the corresponding key (as used in fields()).
143 * Array(string $name => string $uniqueName).
145 public static function &fieldKeys() {
146 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
147 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
149 return Civi
::$statics[__CLASS__
]['fieldKeys'];
153 * Returns the names of this table
157 public static function getTableName() {
158 return self
::$_tableName;
162 * Returns if this table needs to be logged
166 public function getLog() {
171 * Returns the list of fields that can be imported
173 * @param bool $prefix
177 public static function &import($prefix = FALSE) {
178 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_unsubscribe', $prefix, []);
183 * Returns the list of fields that can be exported
185 * @param bool $prefix
189 public static function &export($prefix = FALSE) {
190 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_unsubscribe', $prefix, []);
195 * Returns the list of indices
197 * @param bool $localize
201 public static function indices($localize = TRUE) {
203 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;