Commit 1388f6c8 authored by Jacob Priddy's avatar Jacob Priddy 👌

Added needed string substitutions for null values

parent 12dff97d
......@@ -21,7 +21,7 @@ class WebPresenter extends BasePresenter implements Presenter
return [
'id' => $attempt->getId(),
'door_id' => $attempt->getDoorId(),
'created_at' => self::formatDateTime($attempt->getCreatedAt(), self::HUMAN_DATE_FORMAT),
'created_at' => self::formatDateTime($attempt->getCreatedAt(), self::HUMAN_DATE_FORMAT) ?? 'Unknown',
];
}, $responseModel->getAttempts());
}
......
......@@ -21,7 +21,7 @@ class WebPresenter extends BasePresenter implements Presenter
'user_id' => $entry->getUserId(),
'door_id' => $entry->getDoorId(),
'success' => $entry->wasSuccessful() ? 'Allowed' : 'Denied',
'created_at' => self::formatDateTime($entry->getCreatedAt(), self::HUMAN_DATE_FORMAT),
'created_at' => self::formatDateTime($entry->getCreatedAt(), self::HUMAN_DATE_FORMAT) ?? 'Unknown',
];
}, $responseModel->getEntries());
}
......
......@@ -31,7 +31,7 @@ class WebPresenter extends BasePresenter implements Presenter
'type' => $type,
'start' => self::formatDateTime($override->getStart(), self::HUMAN_DATE_FORMAT),
'end' => self::formatDateTime($override->getEnd(), self::HUMAN_DATE_FORMAT),
'created_at' => self::formatDateTime($override->getCreatedAt(), self::HUMAN_DATE_FORMAT),
'created_at' => self::formatDateTime($override->getCreatedAt(), self::HUMAN_DATE_FORMAT) ?? 'Unknown',
];
}, $responseModel->getOverrides());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment