/**
  * 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;
 }
Example #2
0
 /**
  * @param null $reader
  */
 public function __construct($reader = null)
 {
     parent::__construct($reader);
     $this->wired_type = PBMessage::WIRED_LENGTH_DELIMITED;
 }
Example #3
0
 /**
  * @param null $reader
  */
 public function __construct($reader = null)
 {
     parent::__construct($reader);
     $this->wired_type = PBMessage::WIRED_VARINT;
 }