29 use GetTypeIdFromConstTrait;
31 public const ID = DataStoreOperationType::CHANGE;
33 public function __construct(
35 private string $property,
36 private int $updateCount,
40 public function getName() :
string{
return $this->name; }
42 public function getProperty() :
string{
return $this->property; }
44 public function getUpdateCount() :
int{
return $this->updateCount; }
46 public function getData() : ?
DynamicValue{
return $this->data; }
48 public static function read(ByteBufferReader $in) :
self{
49 $name = CommonTypes::getString($in);
50 $property = CommonTypes::getString($in);
51 $updateCount = LE::readUnsignedInt($in);
53 $type = LE::readUnsignedInt($in);
54 $data = DynamicValue::read($in, $type);
64 public function write(ByteBufferWriter $out) :
void{
65 CommonTypes::putString($out, $this->name);
66 CommonTypes::putString($out, $this->property);
67 LE::writeUnsignedInt($out, $this->updateCount);
70 $type = $this->data?->getTypeId() ?? DynamicValueType::NULL;
71 LE::writeUnsignedInt($out, $type);
72 $this->data?->write($out);