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:b5a2a60211ad6eb943a6aa0db5f88840)
13 * Database access object for the Subscribe entity.
15 class CRM_Mailing_Event_DAO_Subscribe
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_event_subscribe';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
60 * When this subscription event occurred.
69 public function __construct() {
70 $this->__table
= 'civicrm_mailing_event_subscribe';
71 parent
::__construct();
75 * Returns localized title of this entity.
78 * Whether to return the plural version of the title.
80 public static function getEntityTitle($plural = FALSE) {
81 return $plural ?
ts('Subscribes') : ts('Subscribe');
85 * Returns foreign keys and entity references.
88 * [CRM_Core_Reference_Interface]
90 public static function getReferenceColumns() {
91 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
92 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
93 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
94 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
95 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
97 return Civi
::$statics[__CLASS__
]['links'];
101 * Returns all the column names of this table
105 public static function &fields() {
106 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
107 Civi
::$statics[__CLASS__
]['fields'] = [
110 'type' => CRM_Utils_Type
::T_INT
,
111 'title' => ts('Mailing Subscribe ID'),
113 'where' => 'civicrm_mailing_event_subscribe.id',
114 'table_name' => 'civicrm_mailing_event_subscribe',
115 'entity' => 'Subscribe',
116 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
121 'name' => 'group_id',
122 'type' => CRM_Utils_Type
::T_INT
,
123 'title' => ts('Mailing Subscribe Group'),
124 'description' => ts('FK to Group'),
126 'where' => 'civicrm_mailing_event_subscribe.group_id',
127 'table_name' => 'civicrm_mailing_event_subscribe',
128 'entity' => 'Subscribe',
129 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
131 'FKClassName' => 'CRM_Contact_DAO_Group',
135 'pseudoconstant' => [
136 'table' => 'civicrm_group',
138 'labelColumn' => 'title',
143 'name' => 'contact_id',
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Mailing Subscribe Contact'),
146 'description' => ts('FK to Contact'),
148 'where' => 'civicrm_mailing_event_subscribe.contact_id',
149 'table_name' => 'civicrm_mailing_event_subscribe',
150 'entity' => 'Subscribe',
151 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
153 'FKClassName' => 'CRM_Contact_DAO_Contact',
158 'type' => CRM_Utils_Type
::T_STRING
,
159 'title' => ts('Mailing Subscribe Hash'),
160 'description' => ts('Security hash'),
163 'size' => CRM_Utils_Type
::HUGE
,
164 'where' => 'civicrm_mailing_event_subscribe.hash',
165 'table_name' => 'civicrm_mailing_event_subscribe',
166 'entity' => 'Subscribe',
167 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
172 'name' => 'time_stamp',
173 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
174 'title' => ts('Mailing Subscribe Timestamp'),
175 'description' => ts('When this subscription event occurred.'),
177 'where' => 'civicrm_mailing_event_subscribe.time_stamp',
178 'default' => 'CURRENT_TIMESTAMP',
179 'table_name' => 'civicrm_mailing_event_subscribe',
180 'entity' => 'Subscribe',
181 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
186 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
188 return Civi
::$statics[__CLASS__
]['fields'];
192 * Return a mapping from field-name to the corresponding key (as used in fields()).
195 * Array(string $name => string $uniqueName).
197 public static function &fieldKeys() {
198 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
199 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
201 return Civi
::$statics[__CLASS__
]['fieldKeys'];
205 * Returns the names of this table
209 public static function getTableName() {
210 return self
::$_tableName;
214 * Returns if this table needs to be logged
218 public function getLog() {
223 * Returns the list of fields that can be imported
225 * @param bool $prefix
229 public static function &import($prefix = FALSE) {
230 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
235 * Returns the list of fields that can be exported
237 * @param bool $prefix
241 public static function &export($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
247 * Returns the list of indices
249 * @param bool $localize
253 public static function indices($localize = TRUE) {
255 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;