| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @package CRM |
| 5 | * @copyright CiviCRM LLC (c) 2004-2018 |
| 6 | * |
| 7 | * Generated from xml/schema/CRM/Mailing/Event/TrackableURLOpen.xml |
| 8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen |
| 9 | * (GenCodeChecksum:1dd0644af19360b30531b6f23dde78c1) |
| 10 | */ |
| 11 | |
| 12 | /** |
| 13 | * Database access object for the TrackableURLOpen entity. |
| 14 | */ |
| 15 | class CRM_Mailing_Event_DAO_TrackableURLOpen extends CRM_Core_DAO { |
| 16 | |
| 17 | /** |
| 18 | * Static instance to hold the table name. |
| 19 | * |
| 20 | * @var string |
| 21 | */ |
| 22 | static $_tableName = 'civicrm_mailing_event_trackable_url_open'; |
| 23 | |
| 24 | /** |
| 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
| 26 | * |
| 27 | * @var bool |
| 28 | */ |
| 29 | static $_log = FALSE; |
| 30 | |
| 31 | /** |
| 32 | * @var int unsigned |
| 33 | */ |
| 34 | public $id; |
| 35 | |
| 36 | /** |
| 37 | * FK to EventQueue |
| 38 | * |
| 39 | * @var int unsigned |
| 40 | */ |
| 41 | public $event_queue_id; |
| 42 | |
| 43 | /** |
| 44 | * FK to TrackableURL |
| 45 | * |
| 46 | * @var int unsigned |
| 47 | */ |
| 48 | public $trackable_url_id; |
| 49 | |
| 50 | /** |
| 51 | * When this trackable URL open occurred. |
| 52 | * |
| 53 | * @var timestamp |
| 54 | */ |
| 55 | public $time_stamp; |
| 56 | |
| 57 | /** |
| 58 | * Class constructor. |
| 59 | */ |
| 60 | public function __construct() { |
| 61 | $this->__table = 'civicrm_mailing_event_trackable_url_open'; |
| 62 | parent::__construct(); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Returns foreign keys and entity references. |
| 67 | * |
| 68 | * @return array |
| 69 | * [CRM_Core_Reference_Interface] |
| 70 | */ |
| 71 | public static function getReferenceColumns() { |
| 72 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
| 73 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); |
| 74 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); |
| 75 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'trackable_url_id', 'civicrm_mailing_trackable_url', 'id'); |
| 76 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
| 77 | } |
| 78 | return Civi::$statics[__CLASS__]['links']; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Returns all the column names of this table |
| 83 | * |
| 84 | * @return array |
| 85 | */ |
| 86 | public static function &fields() { |
| 87 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
| 88 | Civi::$statics[__CLASS__]['fields'] = [ |
| 89 | 'id' => [ |
| 90 | 'name' => 'id', |
| 91 | 'type' => CRM_Utils_Type::T_INT, |
| 92 | 'title' => ts('Trackable URL Open ID'), |
| 93 | 'required' => TRUE, |
| 94 | 'table_name' => 'civicrm_mailing_event_trackable_url_open', |
| 95 | 'entity' => 'TrackableURLOpen', |
| 96 | 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen', |
| 97 | 'localizable' => 0, |
| 98 | ], |
| 99 | 'event_queue_id' => [ |
| 100 | 'name' => 'event_queue_id', |
| 101 | 'type' => CRM_Utils_Type::T_INT, |
| 102 | 'title' => ts('Event Queue'), |
| 103 | 'description' => ts('FK to EventQueue'), |
| 104 | 'required' => TRUE, |
| 105 | 'table_name' => 'civicrm_mailing_event_trackable_url_open', |
| 106 | 'entity' => 'TrackableURLOpen', |
| 107 | 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen', |
| 108 | 'localizable' => 0, |
| 109 | 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', |
| 110 | ], |
| 111 | 'trackable_url_id' => [ |
| 112 | 'name' => 'trackable_url_id', |
| 113 | 'type' => CRM_Utils_Type::T_INT, |
| 114 | 'title' => ts('Trackable Url'), |
| 115 | 'description' => ts('FK to TrackableURL'), |
| 116 | 'required' => TRUE, |
| 117 | 'table_name' => 'civicrm_mailing_event_trackable_url_open', |
| 118 | 'entity' => 'TrackableURLOpen', |
| 119 | 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen', |
| 120 | 'localizable' => 0, |
| 121 | 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL', |
| 122 | ], |
| 123 | 'time_stamp' => [ |
| 124 | 'name' => 'time_stamp', |
| 125 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
| 126 | 'title' => ts('Timestamp'), |
| 127 | 'description' => ts('When this trackable URL open occurred.'), |
| 128 | 'required' => TRUE, |
| 129 | 'default' => 'CURRENT_TIMESTAMP', |
| 130 | 'table_name' => 'civicrm_mailing_event_trackable_url_open', |
| 131 | 'entity' => 'TrackableURLOpen', |
| 132 | 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen', |
| 133 | 'localizable' => 0, |
| 134 | ], |
| 135 | ]; |
| 136 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
| 137 | } |
| 138 | return Civi::$statics[__CLASS__]['fields']; |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
| 143 | * |
| 144 | * @return array |
| 145 | * Array(string $name => string $uniqueName). |
| 146 | */ |
| 147 | public static function &fieldKeys() { |
| 148 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
| 149 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); |
| 150 | } |
| 151 | return Civi::$statics[__CLASS__]['fieldKeys']; |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Returns the names of this table |
| 156 | * |
| 157 | * @return string |
| 158 | */ |
| 159 | public static function getTableName() { |
| 160 | return self::$_tableName; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Returns if this table needs to be logged |
| 165 | * |
| 166 | * @return bool |
| 167 | */ |
| 168 | public function getLog() { |
| 169 | return self::$_log; |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Returns the list of fields that can be imported |
| 174 | * |
| 175 | * @param bool $prefix |
| 176 | * |
| 177 | * @return array |
| 178 | */ |
| 179 | public static function &import($prefix = FALSE) { |
| 180 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []); |
| 181 | return $r; |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * Returns the list of fields that can be exported |
| 186 | * |
| 187 | * @param bool $prefix |
| 188 | * |
| 189 | * @return array |
| 190 | */ |
| 191 | public static function &export($prefix = FALSE) { |
| 192 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []); |
| 193 | return $r; |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * Returns the list of indices |
| 198 | * |
| 199 | * @param bool $localize |
| 200 | * |
| 201 | * @return array |
| 202 | */ |
| 203 | public static function indices($localize = TRUE) { |
| 204 | $indices = []; |
| 205 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
| 206 | } |
| 207 | |
| 208 | } |