public function getByProductID($iProductID)
    {
        if (empty($iProductID)) {
            return $this->arResult;
        }

        //Get product data
        $obProductItem = ProductItem::make($iProductID);
        if ($obProductItem->isEmpty()) {
            return $this->arResult;
        }

        //Add product data to list
        $this->arResult[] = [
            'id'     => $obProductItem->id,
            'name'   => $obProductItem->name,
            'slug'   => $obProductItem->slug,
            'active' => true,
            'item'   => $obProductItem,
        ];

        //Get category data
        $this->addCategoryData($obProductItem->category_id);
        $this->arResult = array_reverse($this->arResult);

        return $this->arResult;
    }
public function getByProductID($iProductID)
    {
        if (empty($iProductID)) {
            return $this->arResult;
        }

        //Get product data
        $obProductItem = ProductItem::make($iProductID);
        if ($obProductItem->isEmpty()) {
            return $this->arResult;
        }

        //Add product data to list
        $this->arResult[] = [
            'id'     => $obProductItem->id,
            'name'   => $obProductItem->name,
            'slug'   => $obProductItem->slug,
            'active' => true,
            'item'   => $obProductItem,
        ];

        //Get category data
        $this->addCategoryData($obProductItem->category_id);
        $this->arResult = array_reverse($this->arResult);

        return $this->arResult;
    }
public function getByProductID ( $ iProductID ) { if ( empty ( $ iProductID ) ) { return $ this -> arResult ; } //Get product data $ obProductItem = ProductItem :: make ( $ iProductID ) ; if ( $ obProductItem -> isEmpty ( ) ) { return $ this -> arResult ; } //Add product data to list $ this -> arResult [ ] = [ 'id' => $ obProductItem -> id , 'name' => $ obProductItem -> name , 'slug' => $ obProductItem -> slug , 'active' => true , 'item' => $ obProductItem , ] ; //Get category data $ this -> addCategoryData ( $ obProductItem -> category_id ) ; $ this -> arResult = array_reverse ( $ this -> arResult ) ; return $ this -> arResult ; }
Get breadcrumbs by product ID
@param int $iProductID
@return array
Get breadcrumbs by product ID