PluginProbe
ReviewX – Multi-Criteria Reviews for WooCommerce with Google Reviews & Schema / trunk
ReviewX – Multi-Criteria Reviews for WooCommerce with Google Reviews & Schema vtrunk
2.5.1 2.5.0 2.4.1 2.4.0 2.3.11 2.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 All 143 releases
reviewx / app / Utilities / Auth / ClientManager.php

ClientManager.php in ReviewX – Multi-Criteria Reviews for WooCommerce with Google Reviews & Schema trunk, at app/Utilities/Auth/ClientManager.php

90 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ReviewX\Utilities\Auth;
4
5 \defined("ABSPATH") || exit;
6 class ClientManager
7 {
8 protected ?object $site = null;
9 public function __construct(?object $site)
10 {
11 $this->set($site);
12 }
13 public function set(?object $client)
14 {
15 // dd($client);
16 $this->site = $client;
17 }
18 public function has() : bool
19 {
20 return $this->site !== null;
21 }
22 public function site() : ?object
23 {
24 return $this->site;
25 }
26 public function getUid() : string
27 {
28 if ($this->has()) {
29 return $this->site->uid;
30 }
31 return '';
32 }
33 public function getSiteId() : int
34 {
35 if ($this->has()) {
36 return $this->site->site_id;
37 }
38 return 0;
39 }
40 public function getName() : string
41 {
42 if ($this->has()) {
43 return $this->site->name;
44 }
45 return '';
46 }
47 public function getDomain() : string
48 {
49 if ($this->has()) {
50 return $this->site->domain;
51 }
52 return '';
53 }
54 public function getUrl() : string
55 {
56 if ($this->has()) {
57 return $this->site->url;
58 }
59 return '';
60 }
61 public function getLocale() : string
62 {
63 if ($this->has()) {
64 return $this->site->locale;
65 }
66 return '';
67 }
68 public function getEmail() : string
69 {
70 if ($this->has()) {
71 return $this->site->email;
72 }
73 return '';
74 }
75 public function getSecret() : string
76 {
77 if ($this->has()) {
78 return $this->site->secret;
79 }
80 return '';
81 }
82 public function getSync() : bool
83 {
84 if ($this->has()) {
85 return (bool) $this->site->is_saas_sync;
86 }
87 return \false;
88 }
89 }
90