private function addCategoryData($data)
    {
        $category = $data['category'];

        $documentSource = $category->getDocumentSource();

        $title = $documentSource['name'];
        if (is_array($title)) {
            $title = current($title);
        }

        $categoryData = [
            'title'      => html_entity_decode($title),
            'url'        => $this->getCategoryUrl($category),
            'breadcrumb' => $this->getCategoryBreadcrumb($category),
        ];

        $data = array_merge($data, $categoryData);

        return $data;
    }
private function addCategoryData($data)
    {
        $category = $data['category'];

        $documentSource = $category->getDocumentSource();

        $title = $documentSource['name'];
        if (is_array($title)) {
            $title = current($title);
        }

        $categoryData = [
            'title'      => html_entity_decode($title),
            'url'        => $this->getCategoryUrl($category),
            'breadcrumb' => $this->getCategoryBreadcrumb($category),
        ];

        $data = array_merge($data, $categoryData);

        return $data;
    }
private function addCategoryData ( $ data ) { $ category = $ data [ 'category' ] ; $ documentSource = $ category -> getDocumentSource ( ) ; $ title = $ documentSource [ 'name' ] ; if ( is_array ( $ title ) ) { $ title = current ( $ title ) ; } $ categoryData = [ 'title' => html_entity_decode ( $ title ) , 'url' => $ this -> getCategoryUrl ( $ category ) , 'breadcrumb' => $ this -> getCategoryBreadcrumb ( $ category ) , ] ; $ data = array_merge ( $ data , $ categoryData ) ; return $ data ; }
Load category data and append them to the original data.

@param array $data Autocomplete item data.

@return array
Load category data and append them to the original data .