Added convertion method for DateTime into timestamp as string

This commit is contained in:
Anton Babenko 2011-07-12 16:18:47 +02:00
commit 1eee6e92ff

View file

@ -69,6 +69,8 @@ class ModelToElasticaAutoTransformer implements ModelToElasticaTransformerInterf
$value = array_map(function($v) {
return (string) $v;
}, is_array($value) ? $value : iterator_to_array($value));
} elseif ($value instanceof \DateTime) {
$value = (string) $value->format("U");
} else {
$value = (string) $value;
}