Added convertion method for DateTime into timestamp as string
This commit is contained in:
parent
f92247cc6f
commit
1eee6e92ff
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue