public function get(Identifier $id)
 {
     $row = $this->query()->sharedLock()->where('id', $id->serialize())->first();
     if (!$row) {
         throw new \Exception("The Player Snapshot [" . $id->serialize() . "] does not exist.");
     }
     $row_array = (array) $row;
     return $this->snapshot_factory->make($row_array);
 }
 public function id(Identifier $id)
 {
     $snapshot_row = $this->query()->where('id', $id->serialize())->first();
     $snapshot_row = (array) $snapshot_row;
     if (!$snapshot_row) {
         return $this->state_snapshot_factory->create($id);
     }
     $snapshot_row['state'] = json_decode($snapshot_row['state'], true);
     return $this->state_snapshot_factory->tree($snapshot_row);
 }
예제 #3
0
 public function get_class(Identifier $id)
 {
     return $this->id_map[$id->serialize()];
 }
예제 #4
0
 public function exists(Identifier $id)
 {
     return array_key_exists($id->serialize(), $this->index);
 }