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:4e58345d210aa786e7653982fc998c37)
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 public static $_tableName = 'civicrm_mailing_trackable_url';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
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 'where' => 'civicrm_mailing_trackable_url.id',
87 'table_name' => 'civicrm_mailing_trackable_url',
88 'entity' => 'TrackableURL',
89 'bao' => 'CRM_Mailing_BAO_TrackableURL',
94 'type' => CRM_Utils_Type
::T_TEXT
,
96 'description' => ts('The URL to be tracked.'),
98 'where' => 'civicrm_mailing_trackable_url.url',
99 'table_name' => 'civicrm_mailing_trackable_url',
100 'entity' => 'TrackableURL',
101 'bao' => 'CRM_Mailing_BAO_TrackableURL',
105 'name' => 'mailing_id',
106 'type' => CRM_Utils_Type
::T_INT
,
107 'title' => ts('Mailing'),
108 'description' => ts('FK to the mailing'),
110 'where' => 'civicrm_mailing_trackable_url.mailing_id',
111 'table_name' => 'civicrm_mailing_trackable_url',
112 'entity' => 'TrackableURL',
113 'bao' => 'CRM_Mailing_BAO_TrackableURL',
115 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
118 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
120 return Civi
::$statics[__CLASS__
]['fields'];
124 * Return a mapping from field-name to the corresponding key (as used in fields()).
127 * Array(string $name => string $uniqueName).
129 public static function &fieldKeys() {
130 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
131 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
133 return Civi
::$statics[__CLASS__
]['fieldKeys'];
137 * Returns the names of this table
141 public static function getTableName() {
142 return self
::$_tableName;
146 * Returns if this table needs to be logged
150 public function getLog() {
155 * Returns the list of fields that can be imported
157 * @param bool $prefix
161 public static function &import($prefix = FALSE) {
162 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
167 * Returns the list of fields that can be exported
169 * @param bool $prefix
173 public static function &export($prefix = FALSE) {
174 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
179 * Returns the list of indices
181 * @param bool $localize
185 public static function indices($localize = TRUE) {
187 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;