Skip to content

Commit

Permalink
wip: datetime from timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Oct 11, 2023
1 parent ceac0a6 commit 9b38262
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Fetchable.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ protected function castRow(
$key = key($assocArray);
$value = $assocArray[$key];

if($type === Type::DATETIME && is_numeric($value)) {
$value = "@$value";
}

return match ($type) {
Type::BOOL, "boolean" => (bool)$value,
Type::INT, "integer" => (int)$value,
Expand Down

0 comments on commit 9b38262

Please sign in to comment.