MCPcopy Create free account
hub / github.com/MaterializeInc/demos / validate

Method validate

connection-examples/php/state.php:58–66  ·  view source on GitHub ↗
($timestamp)

Source from the content-addressed store, hash-verified

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());

Callers 1

updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected