Merge pull request #12 from antonbabenko/master
Added convertion method for DateTime into timestamp as string
This commit is contained in:
commit
e137f4c2df
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue