handleJson($json);
$this->orderItems();
$this->limitItems();
}
/**
* Handle JSON
*/
private function handleJson($json)
{
$graveyard = json_decode($json, true);
foreach ($graveyard as $tombstone) {
$item = [];
$openDate = new DateTime($tombstone['dateOpen']);
$closeDate = new DateTime($tombstone['dateClose']);
$currentDate = new DateTime();
$yearOpened = $openDate->format('Y');
$yearClosed = $closeDate->format('Y');
if ($closeDate > $currentDate) {
continue;
}
$item['title'] = $tombstone['name'] . ' (' . $yearOpened . ' - ' . $yearClosed . ')';
$item['uid'] = $tombstone['slug'];
$item['uri'] = $tombstone['link'];
$item['timestamp'] = strtotime($tombstone['dateClose']);
$item['content'] = <<