filter(function(RouteWrapper $route) use ($link_types) { return in_array($route['type'], $link_types); }); } /** * Gets all items which expose a link of any kind. * * @return static */ public function getAllLinks() { return $this->filter(function(RouteWrapper $route) { return $route->hasLink(); }); } /** * Gets all normal links. * * @return static */ public function getLinks() { return $this->filter(function(RouteWrapper $route) { return $route->isLink(); }); } /** * Gets all local tasks. * * @return static */ public function getLocalTasks() { return $this->filter(function(RouteWrapper $route) { return $route->isLocalTask(); }); } /** * Gets all default local tasks. * * @return static */ public function getDefaultLocalTasks() { return $this->filter(function(RouteWrapper $route) { return $route->isDefaultLocalTask(); }); } /** * Gets all local actions. * * @return static */ public function getLocalActions() { return $this->filter(function(RouteWrapper $route) { return $route->isLocalAction(); }); } /** * Gets all contextual links. * * @return static */ public function getContextualLinks() { return $this->filter(function(RouteWrapper $route) { return $route->isContextualLink(); }); } }