-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGdprToolbox.php
72 lines (53 loc) · 1.22 KB
/
GdprToolbox.php
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 GdprToolbox {
protected $key;
protected $email;
protected $plugin_name;
protected $plugin_slug;
protected $fields;
protected $anonymize_cbs;
private $gdpr_data_container;
public function __construct( $email ) {
$this->email = $email;
// if( $this->plugin_name != '') {
// return new GdprPrivacy( $email );
// }
$this->gdpr_data_container = GdprDataContainer::Instance();
$this->gdpr_data_container->email = $email;
}
public function set_key( $key ) {
$this->key = $key;
$this->update_data();
}
public function get_key() {
return $this->key;
}
public function set_plugin_name( $name ) {
$this->plugin_name = $name;
$this->update_data();
}
public function get_email() {
return $this->email;
}
public function set_anonymize_cb( $cb ) {
$this->anonymize_cbs[] = $cb;
$this->update_data();
}
public function get_anonymize_cb() {
return $this->anonymize_cbs;
}
/**
* set_field
*
* @param [array] $field
* @return void
*/
public function set_field( $field ) {
$this->fields[] = $field;
$this->update_data();
//update main med data fra denne instance
}
private function update_data() {
$this->gdpr_data_container->update_data( $this );
}
}