5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/Unsubscribe.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b94d81304a2444e6200faad7c2703a87)
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 public static $_tableName = 'civicrm_mailing_event_unsubscribe';
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 * 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 'where' => 'civicrm_mailing_event_unsubscribe.id',
94 'table_name' => 'civicrm_mailing_event_unsubscribe',
95 'entity' => 'Unsubscribe',
96 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe',
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 'where' => 'civicrm_mailing_event_unsubscribe.event_queue_id',
106 'table_name' => 'civicrm_mailing_event_unsubscribe',
107 'entity' => 'Unsubscribe',
108 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe',
110 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
112 'org_unsubscribe' => [
113 'name' => 'org_unsubscribe',
114 'type' => CRM_Utils_Type
::T_BOOLEAN
,
115 'title' => ts('Unsubscribe is for Organization?'),
116 'description' => ts('Unsubscribe at org- or group-level'),
118 'where' => 'civicrm_mailing_event_unsubscribe.org_unsubscribe',
119 'table_name' => 'civicrm_mailing_event_unsubscribe',
120 'entity' => 'Unsubscribe',
121 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe',
125 'name' => 'time_stamp',
126 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
127 'title' => ts('Unsubscribe Timestamp'),
128 'description' => ts('When this delivery event occurred.'),
130 'where' => 'civicrm_mailing_event_unsubscribe.time_stamp',
131 'default' => 'CURRENT_TIMESTAMP',
132 'table_name' => 'civicrm_mailing_event_unsubscribe',
133 'entity' => 'Unsubscribe',
134 'bao' => 'CRM_Mailing_Event_BAO_Unsubscribe',
138 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
140 return Civi
::$statics[__CLASS__
]['fields'];
144 * Return a mapping from field-name to the corresponding key (as used in fields()).
147 * Array(string $name => string $uniqueName).
149 public static function &fieldKeys() {
150 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
151 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
153 return Civi
::$statics[__CLASS__
]['fieldKeys'];
157 * Returns the names of this table
161 public static function getTableName() {
162 return self
::$_tableName;
166 * Returns if this table needs to be logged
170 public function getLog() {
175 * Returns the list of fields that can be imported
177 * @param bool $prefix
181 public static function &import($prefix = FALSE) {
182 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_unsubscribe', $prefix, []);
187 * Returns the list of fields that can be exported
189 * @param bool $prefix
193 public static function &export($prefix = FALSE) {
194 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_unsubscribe', $prefix, []);
199 * Returns the list of indices
201 * @param bool $localize
205 public static function indices($localize = TRUE) {
207 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;