/** * Serializes type */ public function SerializeToString($rec = -1) { // now convert signed int to int $save = $this->value; if ($this->value < 0) { $this->value = abs($this->value) * 2 - 1; } else { $this->value = $this->value * 2; } $string = parent::SerializeToString($rec); // restore value $this->value = $save; return $string; }
/** * @param null $reader */ public function __construct($reader = null) { parent::__construct($reader); $this->wired_type = PBMessage::WIRED_LENGTH_DELIMITED; }
/** * @param null $reader */ public function __construct($reader = null) { parent::__construct($reader); $this->wired_type = PBMessage::WIRED_VARINT; }