5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/Event/Subscribe.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a18362fb8ab1b7cd9b6f5450fcf367f5)
13 * Database access object for the Subscribe entity.
15 class CRM_Mailing_Event_DAO_Subscribe
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_mailing_event_subscribe';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
58 * When this subscription event occurred.
67 public function __construct() {
68 $this->__table
= 'civicrm_mailing_event_subscribe';
69 parent
::__construct();
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(), 'group_id', 'civicrm_group', 'id');
82 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', '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('Mailing Subscribe ID'),
101 'table_name' => 'civicrm_mailing_event_subscribe',
102 'entity' => 'Subscribe',
103 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
107 'name' => 'group_id',
108 'type' => CRM_Utils_Type
::T_INT
,
109 'title' => ts('Mailing Subscribe Group'),
110 'description' => ts('FK to Group'),
112 'table_name' => 'civicrm_mailing_event_subscribe',
113 'entity' => 'Subscribe',
114 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
116 'FKClassName' => 'CRM_Contact_DAO_Group',
120 'pseudoconstant' => [
121 'table' => 'civicrm_group',
123 'labelColumn' => 'title',
127 'name' => 'contact_id',
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('Mailing Subscribe Contact'),
130 'description' => ts('FK to Contact'),
132 'table_name' => 'civicrm_mailing_event_subscribe',
133 'entity' => 'Subscribe',
134 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
136 'FKClassName' => 'CRM_Contact_DAO_Contact',
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('Mailing Subscribe Hash'),
142 'description' => ts('Security hash'),
145 'size' => CRM_Utils_Type
::HUGE
,
146 'table_name' => 'civicrm_mailing_event_subscribe',
147 'entity' => 'Subscribe',
148 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
152 'name' => 'time_stamp',
153 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
154 'title' => ts('Mailing Subscribe Timestamp'),
155 'description' => ts('When this subscription event occurred.'),
157 'default' => 'CURRENT_TIMESTAMP',
158 'table_name' => 'civicrm_mailing_event_subscribe',
159 'entity' => 'Subscribe',
160 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
164 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
166 return Civi
::$statics[__CLASS__
]['fields'];
170 * Return a mapping from field-name to the corresponding key (as used in fields()).
173 * Array(string $name => string $uniqueName).
175 public static function &fieldKeys() {
176 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
177 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
179 return Civi
::$statics[__CLASS__
]['fieldKeys'];
183 * Returns the names of this table
187 public static function getTableName() {
188 return self
::$_tableName;
192 * Returns if this table needs to be logged
196 public function getLog() {
201 * Returns the list of fields that can be imported
203 * @param bool $prefix
207 public static function &import($prefix = FALSE) {
208 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
213 * Returns the list of fields that can be exported
215 * @param bool $prefix
219 public static function &export($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
225 * Returns the list of indices
227 * @param bool $localize
231 public static function indices($localize = TRUE) {
233 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;