Skip to content

Commit 138cb55

Browse files
committed
tidy
1 parent f557cec commit 138cb55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Model.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public function json($flags = JSON_PRETTY_PRINT) {
457457
return json_encode($this->toArray(), $flags);
458458
}
459459

460-
public function toArray($fields = null, $dates_format = null) {
460+
public function toArray($fields = null, $datetime_format = null) {
461461
$model = self::_getModelInfo();
462462
if (!$model) return false;
463463

@@ -469,8 +469,8 @@ public function toArray($fields = null, $dates_format = null) {
469469
$type = self::_setDataType($field, $value);
470470

471471
// format dates if specified
472-
if ($dates_format && ($type === DB::TYPE_DATETIME || in_array($field, ['created_at', 'updated_at', 'deleted_at']))) {
473-
$value = date($dates_format, strtotime($value));
472+
if ($datetime_format && ($type === DB::TYPE_DATETIME || in_array($field, ['created_at', 'updated_at', 'deleted_at']))) {
473+
$value = date($datetime_format, strtotime($value));
474474
}
475475

476476
$result[$field] = $value;

0 commit comments

Comments
 (0)