Adds conversions checks to ensure certain class types and embedded values are properly cast.

Parameters

  • string $format Currently only `array` is supported.
  • array $options

Returns

mixed

Source

						public function to($format, array $options = array()) {
		$defaults = array('handlers' => array(
			'MongoId' => function($value) { return (string) $value; },
			'MongoDate' => function($value) { return $value->sec; }
		));
		$options += $defaults;
		$options['internal'] = false;
		return parent::to($format, $options);
	}