5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/Confirm.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:3d1dae89470e79336dab7506dd173499)
13 * Database access object for the Confirm entity.
15 class CRM_Mailing_Event_DAO_Confirm
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_confirm';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
39 * FK to civicrm_mailing_event_subscribe
43 public $event_subscribe_id;
46 * When this confirmation event occurred.
55 public function __construct() {
56 $this->__table
= 'civicrm_mailing_event_confirm';
57 parent
::__construct();
61 * Returns localized title of this entity.
64 * Whether to return the plural version of the title.
66 public static function getEntityTitle($plural = FALSE) {
67 return $plural ?
ts('Confirms') : ts('Confirm');
71 * Returns foreign keys and entity references.
74 * [CRM_Core_Reference_Interface]
76 public static function getReferenceColumns() {
77 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
78 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
79 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_subscribe_id', 'civicrm_mailing_event_subscribe', 'id');
80 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
82 return Civi
::$statics[__CLASS__
]['links'];
86 * Returns all the column names of this table
90 public static function &fields() {
91 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
92 Civi
::$statics[__CLASS__
]['fields'] = [
95 'type' => CRM_Utils_Type
::T_INT
,
96 'title' => ts('Mailing Confirmation ID'),
98 'where' => 'civicrm_mailing_event_confirm.id',
99 'table_name' => 'civicrm_mailing_event_confirm',
100 'entity' => 'Confirm',
101 'bao' => 'CRM_Mailing_Event_BAO_Confirm',
105 'event_subscribe_id' => [
106 'name' => 'event_subscribe_id',
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('Mailing Subscribe ID'),
109 'description' => ts('FK to civicrm_mailing_event_subscribe'),
111 'where' => 'civicrm_mailing_event_confirm.event_subscribe_id',
112 'table_name' => 'civicrm_mailing_event_confirm',
113 'entity' => 'Confirm',
114 'bao' => 'CRM_Mailing_Event_BAO_Confirm',
116 'FKClassName' => 'CRM_Mailing_Event_DAO_Subscribe',
120 'name' => 'time_stamp',
121 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
122 'title' => ts('Confirm Timestamp'),
123 'description' => ts('When this confirmation event occurred.'),
125 'where' => 'civicrm_mailing_event_confirm.time_stamp',
126 'default' => 'CURRENT_TIMESTAMP',
127 'table_name' => 'civicrm_mailing_event_confirm',
128 'entity' => 'Confirm',
129 'bao' => 'CRM_Mailing_Event_BAO_Confirm',
134 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
136 return Civi
::$statics[__CLASS__
]['fields'];
140 * Return a mapping from field-name to the corresponding key (as used in fields()).
143 * Array(string $name => string $uniqueName).
145 public static function &fieldKeys() {
146 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
147 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
149 return Civi
::$statics[__CLASS__
]['fieldKeys'];
153 * Returns the names of this table
157 public static function getTableName() {
158 return self
::$_tableName;
162 * Returns if this table needs to be logged
166 public function getLog() {
171 * Returns the list of fields that can be imported
173 * @param bool $prefix
177 public static function &import($prefix = FALSE) {
178 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_confirm', $prefix, []);
183 * Returns the list of fields that can be exported
185 * @param bool $prefix
189 public static function &export($prefix = FALSE) {
190 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_confirm', $prefix, []);
195 * Returns the list of indices
197 * @param bool $localize
201 public static function indices($localize = TRUE) {
203 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;