/** * @return mixed */ public function getCurrentNewsItem() { $slug = $this->route->getAddionalURI(); $newsId = intval(substr($slug, strrpos($slug, '-') + 1)); return $this->db->getRepository('\\Extension\\News\\Entity\\News')->findOneById($newsId); }