5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Mailing/TrackableURL.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e0280e1322178bb6d56a8104589c1415)
13 * Database access object for the TrackableURL entity.
15 class CRM_Mailing_DAO_TrackableURL
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_mailing_trackable_url';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
37 * The URL to be tracked.
53 public function __construct() {
54 $this->__table
= 'civicrm_mailing_trackable_url';
55 parent
::__construct();
59 * Returns foreign keys and entity references.
62 * [CRM_Core_Reference_Interface]
64 public static function getReferenceColumns() {
65 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
66 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
67 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
68 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
70 return Civi
::$statics[__CLASS__
]['links'];
74 * Returns all the column names of this table
78 public static function &fields() {
79 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
80 Civi
::$statics[__CLASS__
]['fields'] = [
83 'type' => CRM_Utils_Type
::T_INT
,
84 'title' => ts('Trackable URL ID'),
86 'table_name' => 'civicrm_mailing_trackable_url',
87 'entity' => 'TrackableURL',
88 'bao' => 'CRM_Mailing_BAO_TrackableURL',
93 'type' => CRM_Utils_Type
::T_TEXT
,
95 'description' => ts('The URL to be tracked.'),
97 'table_name' => 'civicrm_mailing_trackable_url',
98 'entity' => 'TrackableURL',
99 'bao' => 'CRM_Mailing_BAO_TrackableURL',
103 'name' => 'mailing_id',
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Mailing'),
106 'description' => ts('FK to the mailing'),
108 'table_name' => 'civicrm_mailing_trackable_url',
109 'entity' => 'TrackableURL',
110 'bao' => 'CRM_Mailing_BAO_TrackableURL',
112 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
115 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
117 return Civi
::$statics[__CLASS__
]['fields'];
121 * Return a mapping from field-name to the corresponding key (as used in fields()).
124 * Array(string $name => string $uniqueName).
126 public static function &fieldKeys() {
127 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
128 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
130 return Civi
::$statics[__CLASS__
]['fieldKeys'];
134 * Returns the names of this table
138 public static function getTableName() {
139 return self
::$_tableName;
143 * Returns if this table needs to be logged
147 public function getLog() {
152 * Returns the list of fields that can be imported
154 * @param bool $prefix
158 public static function &import($prefix = FALSE) {
159 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
164 * Returns the list of fields that can be exported
166 * @param bool $prefix
170 public static function &export($prefix = FALSE) {
171 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
176 * Returns the list of indices
178 * @param bool $localize
182 public static function indices($localize = TRUE) {
184 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;