Skip to content

Commit 508166e

Browse files
committed
Allow setting of timestamp item values with DateTime
1 parent e6fc058 commit 508166e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ or
1717
```
1818
{
1919
"require": {
20-
"recombee/php-api-client": ">=1.2.4"
20+
"recombee/php-api-client": ">=1.2.5"
2121
}
2222
}
2323
```

src/RecommApi/Requests/SetItemValues.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?php
2-
/*
3-
This file is auto-generated, do not edit
4-
*/
52

63
/**
74
* SetItemValues request
@@ -85,9 +82,17 @@ public function getQueryParameters() {
8582
* @return array Values of body parameters (name of parameter => value of the parameter)
8683
*/
8784
public function getBodyParameters() {
88-
$p = array();
89-
$p = array_merge($p, $this->values);
90-
return $p;
85+
86+
$result = array();
87+
foreach($this->values as $key => $value)
88+
{
89+
$result[$key] = $value;
90+
if(is_object($value) && $value instanceof \DateTime)
91+
{
92+
$result[$key] = $value->format(\DateTime::ATOM);
93+
}
94+
}
95+
return $result;
9196
}
9297

9398
}

0 commit comments

Comments
 (0)