Skip to content

Commit

Permalink
feat: make Nested easier to handle
Browse files Browse the repository at this point in the history
  • Loading branch information
taka-oyama committed Aug 10, 2021
1 parent 2ffaa6c commit 7630e93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Colopl/Spanner/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use Google\Cloud\Spanner\Session\SessionPoolInterface;
use Google\Cloud\Spanner\SpannerClient;
use Google\Cloud\Spanner\Transaction;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Database\Connection as BaseConnection;
use Illuminate\Database\QueryException;
use Psr\Cache\CacheItemPoolInterface;
Expand Down Expand Up @@ -412,7 +413,7 @@ public function prepareBindings(array $bindings)
if ($value instanceof DateTimeInterface) {
$bindings[$key] = $value->format($grammar->getDateFormat());
}
else if ($value instanceof Nested) {
else if ($value instanceof Arrayable) {
$bindings[$key] = $value->toArray();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Colopl/Spanner/Query/Nested.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* @internal use only for UNNESTing
*/
class Nested
class Nested implements Arrayable
{
/**
* @var array
Expand Down

0 comments on commit 7630e93

Please sign in to comment.