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 | /** |
||
31 | * @param mixed[] $data data in the form [formatter => value], the first entry will be used as identifier |
||
32 | * @param string|null $uniqueKey |
||
33 | */ |
||
34 | function __construct($data = array(), $uniqueKey = null) |
||
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | function getIdentifier() |
||
47 | |||
48 | /** |
||
49 | * @return AnonymizableValue[] |
||
50 | */ |
||
51 | function getValues() |
||
55 | |||
56 | /** |
||
57 | * Sets raw data from database |
||
58 | * |
||
59 | * @param string[] $data |
||
60 | * @return void |
||
61 | */ |
||
62 | function setRawData($data) |
||
71 | |||
72 | /** |
||
73 | * Update values in database |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | function updateValues() |
||
81 | |||
82 | /** |
||
83 | * Reset to empty instance |
||
84 | * |
||
85 | * @return mixed |
||
86 | */ |
||
87 | function clearInstance() |
||
92 | |||
93 | /** |
||
94 | * Returns name of entity as translatable string |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | function getEntityName() |
||
102 | |||
103 | } |
||
104 |
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.