($timestamp)
| 56 | } |
| 57 | |
| 58 | public function validate($timestamp) { |
| 59 | if (!$this->valid) { |
| 60 | throw new Exception("Invalid state."); |
| 61 | } elseif ($timestamp < $this->timestamp) { |
| 62 | echo "Invalid timestamp."; |
| 63 | $this->valid = false; |
| 64 | throw new Exception("Update with timestamp ($timestamp) is lower than the last timestamp ({$this->timestamp}). Invalid state."); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | public function process(Update $update) { |
| 69 | $value = json_encode($update->getValue()); |