return [
'endpoints' => [
'journal/<entryId:\d+>.json' => function($entryId) {
return [
'elementType' => 'Entry',
'criteria' => ['id' => $entryId, 'section'=>'journal'],
'first' => true,
'transformer' => function(EntryModel $entry) {
$nextEntry = $entry->getNextSibling();
// also tried getNext()
$upNext = [];
$upNext["title"] = $nextEntry->title;
// errs out here ...
}
];
}
]
];
I feel like I'm missing something obvious, but how do I get the next sibling of an entry using Element API? Would it be easier/better to pass both the current entry ID and the next entry ID (which I have available) into the criteria to make it easier to grab?
Thanks!