- // backward compatibility: ignore reorder if the the `created` field doesn't exist
- if (! isset(array_values($this->_links)[0]['created'])) {
- return;
- }
-
- $order = $order === 'ASC' ? -1 : 1;
- // Reorder array by dates.
- usort($this->_links, function($a, $b) use ($order) {
- if (isset($a['sticky']) && isset($b['sticky']) && $a['sticky'] !== $b['sticky']) {
- return $a['sticky'] ? -1 : 1;
+ if (! $this->isLegacy) {
+ $this->bookmarks->reorder($order);
+ } else {
+ $order = $order === 'ASC' ? -1 : 1;
+ // backward compatibility: ignore reorder if the the `created` field doesn't exist
+ if (! isset(array_values($this->bookmarks)[0]['created'])) {
+ return;