-
Notifications
You must be signed in to change notification settings - Fork 362
Expand file tree
/
Copy pathSite_Goals_Settings_Datapoint.php
More file actions
72 lines (65 loc) · 1.92 KB
/
Copy pathSite_Goals_Settings_Datapoint.php
File metadata and controls
72 lines (65 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* Class Google\Site_Kit\Modules\Analytics_4\Datapoints\Site_Goals_Settings_Datapoint
*
* @package Google\Site_Kit\Modules\Analytics_4\Datapoints
* @copyright 2026 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://sitekit.withgoogle.com
*/
namespace Google\Site_Kit\Modules\Analytics_4\Datapoints;
use Google\Site_Kit\Core\Modules\Executable_Datapoint;
use Google\Site_Kit\Core\Modules\Permission_Aware_Datapoint;
use Google\Site_Kit\Core\Modules\Shareable_Datapoint;
use Google\Site_Kit\Core\Permissions\Permissions;
use Google\Site_Kit\Core\REST_API\Data_Request;
use Google\Site_Kit\Modules\Analytics_4\Site_Goals_Settings;
/**
* Base class for the per-user Site Goals settings datapoints.
*
* @since n.e.x.t
* @access private
* @ignore
*/
abstract class Site_Goals_Settings_Datapoint extends Shareable_Datapoint implements Executable_Datapoint, Permission_Aware_Datapoint {
/**
* Site Goals settings instance.
*
* @since n.e.x.t
* @var Site_Goals_Settings
*/
protected $site_goals_settings;
/**
* Constructor.
*
* @since n.e.x.t
*
* @param array $definition Definition fields.
*/
public function __construct( array $definition ) {
parent::__construct( $definition );
$this->site_goals_settings = $definition['site_goals_settings'];
}
/**
* Parses a response.
*
* @since n.e.x.t
*
* @param mixed $response Request response.
* @param Data_Request $data Data request object.
* @return mixed The response without any modifications.
*/
public function parse_response( $response, Data_Request $data ) {
return $response;
}
/**
* Checks whether the current user is allowed to access the datapoint.
*
* @since n.e.x.t
*
* @return bool True if the current user can view the dashboard, false otherwise.
*/
public function permission_callback() {
return current_user_can( Permissions::VIEW_DASHBOARD );
}
}