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:bb9b5b86711ef2bd50ded42eb15c7096)
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',
111 'type' => CRM_Utils_Type
::T_TEXT
,
112 'title' => ts('Url'),
113 'description' => ts('The URL to be tracked.'),
115 'where' => 'civicrm_mailing_trackable_url.url',
116 'table_name' => 'civicrm_mailing_trackable_url',
117 'entity' => 'TrackableURL',
118 'bao' => 'CRM_Mailing_BAO_TrackableURL',
123 'name' => 'mailing_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Mailing ID'),
126 'description' => ts('FK to the mailing'),
128 'where' => 'civicrm_mailing_trackable_url.mailing_id',
129 'table_name' => 'civicrm_mailing_trackable_url',
130 'entity' => 'TrackableURL',
131 'bao' => 'CRM_Mailing_BAO_TrackableURL',
133 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
135 'label' => ts("Mailing"),
140 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
142 return Civi
::$statics[__CLASS__
]['fields'];
146 * Return a mapping from field-name to the corresponding key (as used in fields()).
149 * Array(string $name => string $uniqueName).
151 public static function &fieldKeys() {
152 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
153 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
155 return Civi
::$statics[__CLASS__
]['fieldKeys'];
159 * Returns the names of this table
163 public static function getTableName() {
164 return self
::$_tableName;
168 * Returns if this table needs to be logged
172 public function getLog() {
177 * Returns the list of fields that can be imported
179 * @param bool $prefix
183 public static function &import($prefix = FALSE) {
184 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
189 * Returns the list of fields that can be exported
191 * @param bool $prefix
195 public static function &export($prefix = FALSE) {
196 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
201 * Returns the list of indices
203 * @param bool $localize
207 public static function indices($localize = TRUE) {
209 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;