5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/TrackableURL.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4c224c28653ab679c03fb8e98ddc3401)
13 * Database access object for the TrackableURL entity.
15 class CRM_Mailing_DAO_TrackableURL
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
18 const COMPONENT
= 'CiviMail';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_mailing_trackable_url';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
40 * The URL to be tracked.
56 public function __construct() {
57 $this->__table
= 'civicrm_mailing_trackable_url';
58 parent
::__construct();
62 * Returns localized title of this entity.
65 * Whether to return the plural version of the title.
67 public static function getEntityTitle($plural = FALSE) {
68 return $plural ?
ts('Trackable URLs') : ts('Trackable URL');
72 * Returns foreign keys and entity references.
75 * [CRM_Core_Reference_Interface]
77 public static function getReferenceColumns() {
78 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
79 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
80 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
81 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
83 return Civi
::$statics[__CLASS__
]['links'];
87 * Returns all the column names of this table
91 public static function &fields() {
92 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
93 Civi
::$statics[__CLASS__
]['fields'] = [
96 'type' => CRM_Utils_Type
::T_INT
,
97 'title' => ts('Trackable URL ID'),
99 'where' => 'civicrm_mailing_trackable_url.id',
100 'table_name' => 'civicrm_mailing_trackable_url',
101 'entity' => 'TrackableURL',
102 'bao' => 'CRM_Mailing_BAO_TrackableURL',
112 'type' => CRM_Utils_Type
::T_TEXT
,
113 'title' => ts('Url'),
114 'description' => ts('The URL to be tracked.'),
116 'where' => 'civicrm_mailing_trackable_url.url',
117 'table_name' => 'civicrm_mailing_trackable_url',
118 'entity' => 'TrackableURL',
119 'bao' => 'CRM_Mailing_BAO_TrackableURL',
124 'name' => 'mailing_id',
125 'type' => CRM_Utils_Type
::T_INT
,
126 'title' => ts('Mailing ID'),
127 'description' => ts('FK to the mailing'),
129 'where' => 'civicrm_mailing_trackable_url.mailing_id',
130 'table_name' => 'civicrm_mailing_trackable_url',
131 'entity' => 'TrackableURL',
132 'bao' => 'CRM_Mailing_BAO_TrackableURL',
134 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
136 'label' => ts("Mailing"),
141 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
143 return Civi
::$statics[__CLASS__
]['fields'];
147 * Return a mapping from field-name to the corresponding key (as used in fields()).
150 * Array(string $name => string $uniqueName).
152 public static function &fieldKeys() {
153 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
154 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
156 return Civi
::$statics[__CLASS__
]['fieldKeys'];
160 * Returns the names of this table
164 public static function getTableName() {
165 return self
::$_tableName;
169 * Returns if this table needs to be logged
173 public function getLog() {
178 * Returns the list of fields that can be imported
180 * @param bool $prefix
184 public static function &import($prefix = FALSE) {
185 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
190 * Returns the list of fields that can be exported
192 * @param bool $prefix
196 public static function &export($prefix = FALSE) {
197 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
202 * Returns the list of indices
204 * @param bool $localize
208 public static function indices($localize = TRUE) {
210 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;