1 | <?php |
||
22 | class AnonymizableMock implements AnonymizableEntity |
||
23 | { |
||
24 | const __CLASS = __CLASS__; |
||
25 | |||
26 | private $data = array(); |
||
27 | private $identifier = ''; |
||
28 | private $uniqueKey = null; |
||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | private $isAnonymizable; |
||
33 | |||
34 | /** |
||
35 | * @param mixed[] $data data in the form [formatter => value], the first entry will be used as identifier |
||
36 | * @param string|null $uniqueKey |
||
37 | */ |
||
38 | function __construct($data = array(), $uniqueKey = null, $isAnonymizable = true) |
||
44 | |||
45 | function isAnonymizable() |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | function getIdentifier() |
||
57 | |||
58 | /** |
||
59 | * @return AnonymizableValue[] |
||
60 | */ |
||
61 | function getValues() |
||
65 | |||
66 | /** |
||
67 | * Sets raw data from database |
||
68 | * |
||
69 | * @param string[] $data |
||
70 | * @return void |
||
71 | */ |
||
72 | function setRawData($data) |
||
81 | |||
82 | /** |
||
83 | * Update values in database |
||
84 | * |
||
85 | * @return mixed |
||
86 | */ |
||
87 | function updateValues() |
||
91 | |||
92 | /** |
||
93 | * Reset to empty instance |
||
94 | * |
||
95 | * @return mixed |
||
96 | */ |
||
97 | function clearInstance() |
||
102 | |||
103 | /** |
||
104 | * Returns name of entity as translatable string |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | function getEntityName() |
||
112 | |||
113 | } |
||
114 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.