コード例 #1
0
ファイル: PBSignedInt.php プロジェクト: wy0727/getui
 /**
  * Serializes type
  * @param mixed $rec
  * @return mixed
  */
 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 *= 2;
     }
     $string = parent::serializeToString($rec);
     // restore value
     $this->value = $save;
     return $string;
 }