5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/Subscribe.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:acb361992fd2db48c82ee7b13f8b7cf4)
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 public static $_tableName = 'civicrm_mailing_event_subscribe';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
58 * When this subscription event occurred.
67 public function __construct() {
68 $this->__table
= 'civicrm_mailing_event_subscribe';
69 parent
::__construct();
73 * Returns localized title of this entity.
75 public static function getEntityTitle() {
76 return ts('Subscribes');
80 * Returns foreign keys and entity references.
83 * [CRM_Core_Reference_Interface]
85 public static function getReferenceColumns() {
86 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
87 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
88 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
89 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
90 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
92 return Civi
::$statics[__CLASS__
]['links'];
96 * Returns all the column names of this table
100 public static function &fields() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
102 Civi
::$statics[__CLASS__
]['fields'] = [
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Mailing Subscribe ID'),
108 'where' => 'civicrm_mailing_event_subscribe.id',
109 'table_name' => 'civicrm_mailing_event_subscribe',
110 'entity' => 'Subscribe',
111 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
116 'name' => 'group_id',
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('Mailing Subscribe Group'),
119 'description' => ts('FK to Group'),
121 'where' => 'civicrm_mailing_event_subscribe.group_id',
122 'table_name' => 'civicrm_mailing_event_subscribe',
123 'entity' => 'Subscribe',
124 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
126 'FKClassName' => 'CRM_Contact_DAO_Group',
130 'pseudoconstant' => [
131 'table' => 'civicrm_group',
133 'labelColumn' => 'title',
138 'name' => 'contact_id',
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('Mailing Subscribe Contact'),
141 'description' => ts('FK to Contact'),
143 'where' => 'civicrm_mailing_event_subscribe.contact_id',
144 'table_name' => 'civicrm_mailing_event_subscribe',
145 'entity' => 'Subscribe',
146 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
148 'FKClassName' => 'CRM_Contact_DAO_Contact',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Mailing Subscribe Hash'),
155 'description' => ts('Security hash'),
158 'size' => CRM_Utils_Type
::HUGE
,
159 'where' => 'civicrm_mailing_event_subscribe.hash',
160 'table_name' => 'civicrm_mailing_event_subscribe',
161 'entity' => 'Subscribe',
162 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
167 'name' => 'time_stamp',
168 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
169 'title' => ts('Mailing Subscribe Timestamp'),
170 'description' => ts('When this subscription event occurred.'),
172 'where' => 'civicrm_mailing_event_subscribe.time_stamp',
173 'default' => 'CURRENT_TIMESTAMP',
174 'table_name' => 'civicrm_mailing_event_subscribe',
175 'entity' => 'Subscribe',
176 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
181 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
183 return Civi
::$statics[__CLASS__
]['fields'];
187 * Return a mapping from field-name to the corresponding key (as used in fields()).
190 * Array(string $name => string $uniqueName).
192 public static function &fieldKeys() {
193 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
194 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
196 return Civi
::$statics[__CLASS__
]['fieldKeys'];
200 * Returns the names of this table
204 public static function getTableName() {
205 return self
::$_tableName;
209 * Returns if this table needs to be logged
213 public function getLog() {
218 * Returns the list of fields that can be imported
220 * @param bool $prefix
224 public static function &import($prefix = FALSE) {
225 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
230 * Returns the list of fields that can be exported
232 * @param bool $prefix
236 public static function &export($prefix = FALSE) {
237 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
242 * Returns the list of indices
244 * @param bool $localize
248 public static function indices($localize = TRUE) {
250 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;