Campaign.php
10 months ago
Campaign_Landing_Page.php
9 months ago
Campaign_UTM_Campaign.php
9 months ago
Campaign_UTM_Medium.php
9 months ago
Campaign_UTM_Source.php
9 months ago
ClickWhale_Link_Page.php
1 year ago
Current_Traffic.php
2 years ago
Device.php
10 months ago
Form.php
1 year ago
Geo.php
10 months ago
Journey.php
5 months ago
Link.php
8 months ago
Link_Pattern.php
10 months ago
Model.php
6 months ago
Page.php
10 months ago
Page_Author_Archive.php
2 years ago
Page_Date_Archive.php
2 years ago
Page_Home.php
2 years ago
Page_Not_Found.php
1 year ago
Page_Post_Type_Archive.php
1 year ago
Page_Search.php
2 years ago
Page_Singular.php
1 year ago
Page_Term_Archive.php
2 years ago
Page_Virtual.php
1 year ago
Referrer.php
6 months ago
Referrer_Type.php
9 months ago
Universal_Model_Columns.php
1 year ago
Visitor.php
9 months ago
Device.php
49 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Models; |
| 4 | |
| 5 | /** @internal */ |
| 6 | class Device extends \IAWP\Models\Model |
| 7 | { |
| 8 | use \IAWP\Models\Universal_Model_Columns; |
| 9 | protected $row; |
| 10 | private $type; |
| 11 | private $os; |
| 12 | private $browser; |
| 13 | public function __construct($row) |
| 14 | { |
| 15 | $this->row = $row; |
| 16 | $this->type = $row->device_type ?? null; |
| 17 | $this->os = $row->os ?? null; |
| 18 | $this->browser = $row->browser ?? null; |
| 19 | } |
| 20 | public function id() : int |
| 21 | { |
| 22 | return $this->row->device_type_id ?? $this->row->device_os_id ?? $this->row->device_browser_id; |
| 23 | } |
| 24 | public function table_type() : string |
| 25 | { |
| 26 | return 'devices'; |
| 27 | } |
| 28 | public function device_type() |
| 29 | { |
| 30 | return $this->type; |
| 31 | } |
| 32 | public function browser() |
| 33 | { |
| 34 | return $this->browser; |
| 35 | } |
| 36 | public function os() |
| 37 | { |
| 38 | return $this->os; |
| 39 | } |
| 40 | public function examiner_title() : ?string |
| 41 | { |
| 42 | return $this->type ?? $this->os ?? $this->browser; |
| 43 | } |
| 44 | public function examiner_url() : string |
| 45 | { |
| 46 | return \IAWPSCOPED\iawp_dashboard_url(['tab' => 'devices', 'examiner' => $this->id()]); |
| 47 | } |
| 48 | } |
| 49 |