(NFC) Regenerate DAO Checksums after changes to codegen
[civicrm-core.git] / CRM / Mailing / DAO / TrackableURL.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Mailing/TrackableURL.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e0280e1322178bb6d56a8104589c1415)
10 */
11
12 /**
13 * Database access object for the TrackableURL entity.
14 */
15 class CRM_Mailing_DAO_TrackableURL extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 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 static $_log = FALSE;
30
31 /**
32 * @var int unsigned
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 unsigned
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 foreign keys and entity references.
60 *
61 * @return array
62 * [CRM_Core_Reference_Interface]
63 */
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']);
69 }
70 return Civi::$statics[__CLASS__]['links'];
71 }
72
73 /**
74 * Returns all the column names of this table
75 *
76 * @return array
77 */
78 public static function &fields() {
79 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
80 Civi::$statics[__CLASS__]['fields'] = [
81 'id' => [
82 'name' => 'id',
83 'type' => CRM_Utils_Type::T_INT,
84 'title' => ts('Trackable URL ID'),
85 'required' => TRUE,
86 'table_name' => 'civicrm_mailing_trackable_url',
87 'entity' => 'TrackableURL',
88 'bao' => 'CRM_Mailing_BAO_TrackableURL',
89 'localizable' => 0,
90 ],
91 'url' => [
92 'name' => 'url',
93 'type' => CRM_Utils_Type::T_TEXT,
94 'title' => ts('Url'),
95 'description' => ts('The URL to be tracked.'),
96 'required' => TRUE,
97 'table_name' => 'civicrm_mailing_trackable_url',
98 'entity' => 'TrackableURL',
99 'bao' => 'CRM_Mailing_BAO_TrackableURL',
100 'localizable' => 0,
101 ],
102 'mailing_id' => [
103 'name' => 'mailing_id',
104 'type' => CRM_Utils_Type::T_INT,
105 'title' => ts('Mailing'),
106 'description' => ts('FK to the mailing'),
107 'required' => TRUE,
108 'table_name' => 'civicrm_mailing_trackable_url',
109 'entity' => 'TrackableURL',
110 'bao' => 'CRM_Mailing_BAO_TrackableURL',
111 'localizable' => 0,
112 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
113 ],
114 ];
115 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
116 }
117 return Civi::$statics[__CLASS__]['fields'];
118 }
119
120 /**
121 * Return a mapping from field-name to the corresponding key (as used in fields()).
122 *
123 * @return array
124 * Array(string $name => string $uniqueName).
125 */
126 public static function &fieldKeys() {
127 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
128 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
129 }
130 return Civi::$statics[__CLASS__]['fieldKeys'];
131 }
132
133 /**
134 * Returns the names of this table
135 *
136 * @return string
137 */
138 public static function getTableName() {
139 return self::$_tableName;
140 }
141
142 /**
143 * Returns if this table needs to be logged
144 *
145 * @return bool
146 */
147 public function getLog() {
148 return self::$_log;
149 }
150
151 /**
152 * Returns the list of fields that can be imported
153 *
154 * @param bool $prefix
155 *
156 * @return array
157 */
158 public static function &import($prefix = FALSE) {
159 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_trackable_url', $prefix, []);
160 return $r;
161 }
162
163 /**
164 * Returns the list of fields that can be exported
165 *
166 * @param bool $prefix
167 *
168 * @return array
169 */
170 public static function &export($prefix = FALSE) {
171 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_trackable_url', $prefix, []);
172 return $r;
173 }
174
175 /**
176 * Returns the list of indices
177 *
178 * @param bool $localize
179 *
180 * @return array
181 */
182 public static function indices($localize = TRUE) {
183 $indices = [];
184 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
185 }
186
187 }