コード例 #1
0
ファイル: Encoder.php プロジェクト: rafael-labegalini/zf2
 /**
  * Use the JSON encoding scheme for the value specified
  *
  * @param mixed $value The value to be encoded
  * @param  bool $cycleCheck Whether or not to check for possible object recursion when encoding
  * @param array $options Additional options used during encoding
  * @return string  The encoded value
  */
 public static function encode($value, $cycleCheck = false, $options = array())
 {
     $encoder = new static($cycleCheck ? true : false, $options);
     if ($value instanceof JsonSerializable) {
         $value = $value->jsonSerialize();
     }
     return $encoder->_encodeValue($value);
 }
コード例 #2
0
ファイル: Encoder.php プロジェクト: eltondias/Relogio
 /**
  * Use the JSON encoding scheme for the value specified
  *
  * @param mixed $value The value to be encoded
  * @param  bool $cycleCheck Whether or not to check for possible object recursion when encoding
  * @param array $options Additional options used during encoding
  * @return string  The encoded value
  */
 public static function encode($value, $cycleCheck = false, $options = array())
 {
     $encoder = new static($cycleCheck ? true : false, $options);
     return $encoder->_encodeValue($value);
 }