Merge pull request #12 from antonbabenko/master

Added convertion method for DateTime into timestamp as string
This commit is contained in:
Thibault Duplessis 2011-07-12 09:14:33 -07:00
commit e137f4c2df

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;
}