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:9e1dec99f17dcccde7feeca30b880a85)
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.
77 public static function getEntityTitle() {
78 return ts('Subscribes');
82 * Returns foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
87 public static function getReferenceColumns() {
88 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
89 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
91 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
92 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
94 return Civi
::$statics[__CLASS__
]['links'];
98 * Returns all the column names of this table
102 public static function &fields() {
103 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
104 Civi
::$statics[__CLASS__
]['fields'] = [
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('Mailing Subscribe ID'),
110 'where' => 'civicrm_mailing_event_subscribe.id',
111 'table_name' => 'civicrm_mailing_event_subscribe',
112 'entity' => 'Subscribe',
113 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
118 'name' => 'group_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Mailing Subscribe Group'),
121 'description' => ts('FK to Group'),
123 'where' => 'civicrm_mailing_event_subscribe.group_id',
124 'table_name' => 'civicrm_mailing_event_subscribe',
125 'entity' => 'Subscribe',
126 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
128 'FKClassName' => 'CRM_Contact_DAO_Group',
132 'pseudoconstant' => [
133 'table' => 'civicrm_group',
135 'labelColumn' => 'title',
140 'name' => 'contact_id',
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Mailing Subscribe Contact'),
143 'description' => ts('FK to Contact'),
145 'where' => 'civicrm_mailing_event_subscribe.contact_id',
146 'table_name' => 'civicrm_mailing_event_subscribe',
147 'entity' => 'Subscribe',
148 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
150 'FKClassName' => 'CRM_Contact_DAO_Contact',
155 'type' => CRM_Utils_Type
::T_STRING
,
156 'title' => ts('Mailing Subscribe Hash'),
157 'description' => ts('Security hash'),
160 'size' => CRM_Utils_Type
::HUGE
,
161 'where' => 'civicrm_mailing_event_subscribe.hash',
162 'table_name' => 'civicrm_mailing_event_subscribe',
163 'entity' => 'Subscribe',
164 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
169 'name' => 'time_stamp',
170 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
171 'title' => ts('Mailing Subscribe Timestamp'),
172 'description' => ts('When this subscription event occurred.'),
174 'where' => 'civicrm_mailing_event_subscribe.time_stamp',
175 'default' => 'CURRENT_TIMESTAMP',
176 'table_name' => 'civicrm_mailing_event_subscribe',
177 'entity' => 'Subscribe',
178 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
183 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
185 return Civi
::$statics[__CLASS__
]['fields'];
189 * Return a mapping from field-name to the corresponding key (as used in fields()).
192 * Array(string $name => string $uniqueName).
194 public static function &fieldKeys() {
195 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
196 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
198 return Civi
::$statics[__CLASS__
]['fieldKeys'];
202 * Returns the names of this table
206 public static function getTableName() {
207 return self
::$_tableName;
211 * Returns if this table needs to be logged
215 public function getLog() {
220 * Returns the list of fields that can be imported
222 * @param bool $prefix
226 public static function &import($prefix = FALSE) {
227 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
232 * Returns the list of fields that can be exported
234 * @param bool $prefix
238 public static function &export($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
244 * Returns the list of indices
246 * @param bool $localize
250 public static function indices($localize = TRUE) {
252 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;