PluginProbe
Independent Analytics – WordPress Analytics Plugin / 2.13.5
Independent Analytics – WordPress Analytics Plugin v2.13.5
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / IAWP / Models / Campaign_Landing_Page.php
Campaign_Landing_Page.php
56 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IAWP\Models;
4
5 /** @internal */
6 class Campaign_Landing_Page extends \IAWP\Models\Model
7 {
8 use \IAWP\Models\Universal_Model_Columns;
9 protected $row;
10 private $title;
11 public function __construct($row)
12 {
13 $this->row = $row;
14 $this->title = $row->title;
15 }
16 public function id() : int
17 {
18 return $this->row->landing_page_id;
19 }
20 public function table_type() : string
21 {
22 return 'campaigns';
23 }
24 /*
25 * Column names have shared logic between tables. So "title" for resources has the same logic
26 * as "title" for campaigns. Adding is_deleted ensures that the method can be called even though
27 * campaigns can never be deleted. A better code base would allow this to be removed.
28 */
29 public function is_deleted()
30 {
31 return \false;
32 }
33 public function title()
34 {
35 return $this->title;
36 }
37 /**
38 * This isn't building a URL param that's used in a URL. This is building a unique id that's
39 * used for uniqueness in real-times most popular campaign list.
40 *
41 * @return string
42 */
43 public function params() : string
44 {
45 return \http_build_query(['title' => $this->title()]);
46 }
47 public function examiner_title() : ?string
48 {
49 return $this->title();
50 }
51 public function examiner_url() : string
52 {
53 return \IAWPSCOPED\iawp_dashboard_url(['tab' => 'campaigns', 'examiner' => $this->id()]);
54 }
55 }
56