Searches in all categories for the category that matches a breadcrumb.

@param breadcrumb the breadcrumb, which the matching category should have
@return a matching category or null if nothing is found
966015
private Category searchCategory(String breadcrumb) {
    return model.getFlatCategoriesLst().stream().filter(
        cat -> cat.getBreadcrumb().equals(breadcrumb)
    ).findAny().orElse(null);
  }
777061
private Category getSelectedCategoryByMatch() {
    // Strategy: Go from most specific match to most unspecific match
    Category firstFilteredSetting =
        filteredSettingsLst.size() == 0 ? null : settingCategoryMap.get(filteredSettingsLst.get(0));
    Category firstFilteredGroup =
        filteredGroupsLst.size() == 0 ? null : groupCategoryMap.get(filteredGroupsLst.get(0));
    Category firstFilteredCategory =
        filteredCategoriesLst.size() == 0 ? null : filteredCategoriesLst.get(0);
    return compareMatches(
        firstFilteredSetting, firstFilteredGroup, firstFilteredCategory,
        settingMatches, groupMatches, categoryMatches
    );
  }
927347
def get_breadcrumbs(self):
        
        if not self.breadcrumbs:
            return None
        else:
            allowed_breadcrumbs = []
            for breadcrumb in self.breadcrumbs:

                # check permission based on named_url
                if breadcrumb[1] is not None and not view_from_url(
                    breadcrumb[1]
                ).has_permission(self.request.user):
                    continue

                obj = self if not hasattr(self, "object") else self.object
                url = (
                    None
                    if not breadcrumb[1]
                    else reverse_url(breadcrumb[1], obj)
                )
                allowed_breadcrumbs.append({"name": breadcrumb[0], "url": url})
            return allowed_breadcrumbs
768877
protected function setBreadcrumbListCategory()
    {
        $breadcrumbs = array();

        $breadcrumbs[] = array(
            'url' => $this->url('admin'),
            'text' => $this->text('Dashboard')
        );

        $breadcrumbs[] = array(
            'url' => $this->url('admin/content/category-group'),
            'text' => $this->text('Category groups')
        );

        $this->setBreadcrumbs($breadcrumbs);
    }
599189
private static CmsCategoryTreeEntry findCategory(List<CmsCategoryTreeEntry> tree, String path) {

        if (path == null) {
            return null;
        }
        // we assume that the category to find is descendant of tree
        List<CmsCategoryTreeEntry> children = tree;
        boolean found = true;
        while (found) {
            if (children == null) {
                return null;
            }
            // since the categories are sorted it is faster to go backwards
            found = false;
            for (int i = children.size() - 1; i >= 0; i--) {
                CmsCategoryTreeEntry child = children.get(i);
                if (path.equals(child.getPath())) {
                    return child;
                }
                if (path.startsWith(child.getPath())) {
                    children = child.getChildren();
                    found = true;
                    break;
                }
            }
        }
        return null;
    }
500117
public synchronized void recordBreadcrumb(Breadcrumb breadcrumb) {
        if (breadcrumbs == null) {
            breadcrumbs = new CircularFifoQueue<>(breadcrumbLimit);
        }

        breadcrumbs.add(breadcrumb);
    }
827671
protected function setBreadcrumbEditCategory()
    {
        $breadcrumbs = array();

        $breadcrumbs[] = array(
            'url' => $this->url('admin'),
            'text' => $this->text('Dashboard')
        );

        $breadcrumbs[] = array(
            'url' => $this->url('admin/content/category-group'),
            'text' => $this->text('Category groups')
        );

        $breadcrumbs[] = array(
            'url' => $this->url("admin/content/category/{$this->data_category_group['category_group_id']}"),
            'text' => $this->text('Categories of group %name', array('%name' => $this->data_category_group['title']))
        );

        $this->setBreadcrumbs($breadcrumbs);
    }
598047
public function getBreadcrumb(Page $page = null, $breadcrumb = array())
    {
        if (null === $this->breadcrumb) {
            $page = (null !== $page) ? $page : $this;
            $breadcrumb[] = $page;
            if (null !== $page->getParent()) {
                return $this->getBreadcrumb($page->getParent(), $breadcrumb);
            } else {
                $this->breadcrumb = $breadcrumb;
            }
        }

        return $this->breadcrumb;
    }
634981
public Object loadObject(String breadcrumb, Object defaultObject) {
    String json = getSerializedPreferencesValue(breadcrumb, gson.toJson(defaultObject));
    return gson.fromJson(json, Object.class);
  }
555036
private function getCategoryBreadcrumb(\Magento\Catalog\Model\Category $category)
    {
        $path    = $category->getPath();
        $rawPath = explode('/', $path);

        // First occurence is root category (1), second is root category of store.
        $rawPath = array_slice($rawPath, 2);

        // Last occurence is the category displayed.
        array_pop($rawPath);

        $breadcrumb = [];
        foreach ($rawPath as $categoryId) {
            $breadcrumb[] = html_entity_decode($this->getCategoryNameById($categoryId, $category->getStoreId()));
        }

        return $breadcrumb;
    }
607238
def get_crumb_list_by_selector(self, crumb_selector):
        """"""
        return [
            self.parsedpage.get_text_from_node(crumb)
            for crumb in self.parsedpage.get_nodes_by_selector(crumb_selector)
        ]
1231102
public void setupBreadCrumbBar() {
    String[] stringArr = model.getDisplayedCategory().getBreadcrumb().split(BREADCRUMB_DELIMITER);
    Category[] categories = new Category[stringArr.length];

    // Collecting all parent categories from the displayed category using the breadcrumb.
    // There will always be at least one category which will be added to the breadcrumb.
    categories[0] = searchCategory(stringArr[0]);

    // If there are more than one category in the stringArr[], they will be added. For this reason
    // the Integer in the loop starts with one, thus only the second element in the array is needed.
    for (int i = 1; i < stringArr.length; ++i) {
      stringArr[i] = stringArr[i - 1] + BREADCRUMB_DELIMITER + stringArr[i];
      categories[i] = searchCategory(stringArr[i]);
    }

    breadCrumbView.breadcrumbsItm = BreadCrumbBar.buildTreeModel(categories);
    breadCrumbView.breadCrumbBar.setSelectedCrumb(breadCrumbView.breadcrumbsItm);
  }
415985
protected function validateBreadcrumb(array $breadcrumb)
    {
        foreach ($breadcrumb as $item) {
            if (!is_array($item) || !array_has($item, 'text')) {
                throw new  \Exception('Breadcrumb format error!');
            }
        }

        return true;
    }
660514
public function getBreadCrumb()
    {
        $result = [];
        $current = $this->getCurrent();
        while (!is_null($current)) {
            array_unshift($result, $current);
            $current = $current->getParent();
        }

        return $result;
    }
756928
public synchronized List<Breadcrumb> getBreadcrumbs() {
        if (breadcrumbs == null || breadcrumbs.isEmpty()) {
            return Collections.emptyList();
        }

        List<Breadcrumb> copyList = new ArrayList<>(breadcrumbs.size());
        copyList.addAll(breadcrumbs);
        return copyList;
    }
1322988
public boolean validateCrumb(ServletRequest request) {
        CrumbIssuerDescriptor<CrumbIssuer> desc = getDescriptor();
        String crumbField = desc.getCrumbRequestField();
        String crumbSalt = desc.getCrumbSalt();

        return validateCrumb(request, crumbSalt, request.getParameter(crumbField));
    }
1058159
public function breadcrumbs()
    {
        $links = [];
        $breadcrumbs = $this->crumbs($this->request->segments());
        foreach ($breadcrumbs as $name => $url):
            $links[] = '<a href="' . $url . '" class="breadcrumb">' . ucwords($name) . '</a>';
        endforeach ;
        return $links;
    }