Add titles and icons to entities
[civicrm-core.git] / CRM / Mailing / DAO / TrackableURL.php
... / ...
CommitLineData
1<?php
2
3/**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Mailing/TrackableURL.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:d6ed69fd6ed6a2344ce2349f1c56889f)
10 */
11
12/**
13 * Database access object for the TrackableURL entity.
14 */
15class CRM_Mailing_DAO_TrackableURL extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_mailing_trackable_url';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * @var int
33 */
34 public $id;
35
36 /**
37 * The URL to be tracked.
38 *
39 * @var text
40 */
41 public $url;
42
43 /**
44 * FK to the mailing
45 *
46 * @var int
47 */
48 public $mailing_id;
49
50 /**
51 * Class constructor.
52 */
53 public function __construct() {
54 $this->__table = 'civicrm_mailing_trackable_url';
55 parent::__construct();
56 }
57
58 /**
59 * Returns localized title of this entity.
60 */
61 public static function getEntityTitle() {
62 return ts('Trackable URLs');
63 }
64
65 /**
66 * Returns foreign keys and entity references.
67 *
68 * @return array
69 * [CRM_Core_Reference_Interface]
70 */
71 public static function getReferenceColumns() {
72 if (!isset(Civi::$statics[__CLASS__]['links'])) {
73 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
74 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
75 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
76 }
77 return Civi::$statics[__CLASS__]['links'];
78 }
79
80 /**
81 * Returns all the column names of this table
82 *
83 * @return array
84 */
85 public static function &fields() {
86 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
87 Civi::$statics[__CLASS__]['fields'] = [
88 'id' => [
89 'name' => 'id',
90 'type' => CRM_Utils_Type::T_INT,
91 'title' => ts('Trackable URL ID'),
92 'required' => TRUE,
93 'where' => 'civicrm_mailing_trackable_url.id',
94 'table_name' => 'civicrm_mailing_trackable_url',
95 'entity' => 'TrackableURL',
96 'bao' => 'CRM_Mailing_BAO_TrackableURL',
97 'localizable' => 0,
98 ],
99 'url' => [
100 'name' => 'url',
101 'type' => CRM_Utils_Type::T_TEXT,
102 'title' => ts('Url'),
103 'description' => ts('The URL to be tracked.'),
104 'required' => TRUE,
105 'where' => 'civicrm_mailing_trackable_url.url',
106 'table_name' => 'civicrm_mailing_trackable_url',
107 'entity' => 'TrackableURL',
108 'bao' => 'CRM_Mailing_BAO_TrackableURL',
109 'localizable' => 0,
110 ],
111 'mailing_id' => [
112 'name' => 'mailing_id',
113 'type' => CRM_Utils_Type::T_INT,
114 'title' => ts('Mailing'),
115 'description' => ts('FK to the mailing'),
116 'required' => TRUE,
117 'where' => 'civicrm_mailing_trackable_url.mailing_id',
118 'table_name' => 'civicrm_mailing_trackable_url',
119 'entity' => 'TrackableURL',
120 'bao' => 'CRM_Mailing_BAO_TrackableURL',
121 'localizable' => 0,
122 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
123 ],
124 ];
125 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
126 }
127 return Civi::$statics[__CLASS__]['fields'];
128 }
129
130 /**
131 * Return a mapping from field-name to the corresponding key (as used in fields()).
132 *
133 * @return array
134 * Array(string $name => string $uniqueName).
135 */
136 public static function &fieldKeys() {
137 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
138 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
139 }
140 return Civi::$statics[__CLASS__]['fieldKeys'];
141 }
142
143 /**
144 * Returns the names of this table
145 *
146 * @return string
147 */
148 public static function getTableName() {
149 return self::$_tableName;
150 }
151
152 /**
153 * Returns if this table needs to be logged
154 *
155 * @return bool
156 */
157 public function getLog() {
158 return self::$_log;
159 }
160
161 /**
162 * Returns the list of fields that can be imported
163 *
164 * @param bool $prefix
165 *
166 * @return array
167 */
168 public static function &import($prefix = FALSE) {
169 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_trackable_url', $prefix, []);
170 return $r;
171 }
172
173 /**
174 * Returns the list of fields that can be exported
175 *
176 * @param bool $prefix
177 *
178 * @return array
179 */
180 public static function &export($prefix = FALSE) {
181 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_trackable_url', $prefix, []);
182 return $r;
183 }
184
185 /**
186 * Returns the list of indices
187 *
188 * @param bool $localize
189 *
190 * @return array
191 */
192 public static function indices($localize = TRUE) {
193 $indices = [];
194 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
195 }
196
197}