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:ac0ae37c12d442071e726deb75e8a7ba)
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
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_trackable_url';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
39 * The URL to be tracked.
55 public function __construct() {
56 $this->__table
= 'civicrm_mailing_trackable_url';
57 parent
::__construct();
61 * Returns localized title of this entity.
64 * Whether to return the plural version of the title.
66 public static function getEntityTitle($plural = FALSE) {
67 return $plural ?
ts('Trackable URLs') : ts('Trackable URL');
71 * Returns foreign keys and entity references.
74 * [CRM_Core_Reference_Interface]
76 public static function getReferenceColumns() {
77 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
78 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
79 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
80 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
82 return Civi
::$statics[__CLASS__
]['links'];
86 * Returns all the column names of this table
90 public static function &fields() {
91 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
92 Civi
::$statics[__CLASS__
]['fields'] = [
95 'type' => CRM_Utils_Type
::T_INT
,
96 'title' => ts('Trackable URL ID'),
98 'where' => 'civicrm_mailing_trackable_url.id',
99 'table_name' => 'civicrm_mailing_trackable_url',
100 'entity' => 'TrackableURL',
101 'bao' => 'CRM_Mailing_BAO_TrackableURL',
107 'type' => CRM_Utils_Type
::T_TEXT
,
108 'title' => ts('Url'),
109 'description' => ts('The URL to be tracked.'),
111 'where' => 'civicrm_mailing_trackable_url.url',
112 'table_name' => 'civicrm_mailing_trackable_url',
113 'entity' => 'TrackableURL',
114 'bao' => 'CRM_Mailing_BAO_TrackableURL',
119 'name' => 'mailing_id',
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Mailing'),
122 'description' => ts('FK to the mailing'),
124 'where' => 'civicrm_mailing_trackable_url.mailing_id',
125 'table_name' => 'civicrm_mailing_trackable_url',
126 'entity' => 'TrackableURL',
127 'bao' => 'CRM_Mailing_BAO_TrackableURL',
129 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
133 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
135 return Civi
::$statics[__CLASS__
]['fields'];
139 * Return a mapping from field-name to the corresponding key (as used in fields()).
142 * Array(string $name => string $uniqueName).
144 public static function &fieldKeys() {
145 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
146 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
148 return Civi
::$statics[__CLASS__
]['fieldKeys'];
152 * Returns the names of this table
156 public static function getTableName() {
157 return self
::$_tableName;
161 * Returns if this table needs to be logged
165 public function getLog() {
170 * Returns the list of fields that can be imported
172 * @param bool $prefix
176 public static function &import($prefix = FALSE) {
177 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
182 * Returns the list of fields that can be exported
184 * @param bool $prefix
188 public static function &export($prefix = FALSE) {
189 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_trackable_url', $prefix, []);
194 * Returns the list of indices
196 * @param bool $localize
200 public static function indices($localize = TRUE) {
202 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;