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:97eb613e24b342aeb86b6e82b740ce7c)
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',
115 'name' => 'group_id',
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Mailing Subscribe Group'),
118 'description' => ts('FK to Group'),
120 'where' => 'civicrm_mailing_event_subscribe.group_id',
121 'table_name' => 'civicrm_mailing_event_subscribe',
122 'entity' => 'Subscribe',
123 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
125 'FKClassName' => 'CRM_Contact_DAO_Group',
129 'pseudoconstant' => [
130 'table' => 'civicrm_group',
132 'labelColumn' => 'title',
136 'name' => 'contact_id',
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('Mailing Subscribe Contact'),
139 'description' => ts('FK to Contact'),
141 'where' => 'civicrm_mailing_event_subscribe.contact_id',
142 'table_name' => 'civicrm_mailing_event_subscribe',
143 'entity' => 'Subscribe',
144 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
146 'FKClassName' => 'CRM_Contact_DAO_Contact',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Mailing Subscribe Hash'),
152 'description' => ts('Security hash'),
155 'size' => CRM_Utils_Type
::HUGE
,
156 'where' => 'civicrm_mailing_event_subscribe.hash',
157 'table_name' => 'civicrm_mailing_event_subscribe',
158 'entity' => 'Subscribe',
159 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
163 'name' => 'time_stamp',
164 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
165 'title' => ts('Mailing Subscribe Timestamp'),
166 'description' => ts('When this subscription event occurred.'),
168 'where' => 'civicrm_mailing_event_subscribe.time_stamp',
169 'default' => 'CURRENT_TIMESTAMP',
170 'table_name' => 'civicrm_mailing_event_subscribe',
171 'entity' => 'Subscribe',
172 'bao' => 'CRM_Mailing_Event_BAO_Subscribe',
176 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
178 return Civi
::$statics[__CLASS__
]['fields'];
182 * Return a mapping from field-name to the corresponding key (as used in fields()).
185 * Array(string $name => string $uniqueName).
187 public static function &fieldKeys() {
188 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
189 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
191 return Civi
::$statics[__CLASS__
]['fieldKeys'];
195 * Returns the names of this table
199 public static function getTableName() {
200 return self
::$_tableName;
204 * Returns if this table needs to be logged
208 public function getLog() {
213 * Returns the list of fields that can be imported
215 * @param bool $prefix
219 public static function &import($prefix = FALSE) {
220 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
225 * Returns the list of fields that can be exported
227 * @param bool $prefix
231 public static function &export($prefix = FALSE) {
232 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_subscribe', $prefix, []);
237 * Returns the list of indices
239 * @param bool $localize
243 public static function indices($localize = TRUE) {
245 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;