likeRepository = $likeRepository; } public function __construct() { } public function getItems() { $objs = $this->likeRepository->getTop(10); $items = []; foreach ($objs as $obj) { $title = ''; if ($obj['tablename'] === 'pages') { $page = BackendUtility::getRecord('pages',$obj['object_uid'],'title'); if ($page) { $title = $page['title']; } } $items[] = [ 'title' => $title, 'number' => $obj['number'] ]; } return $items; } }