public function getSaleProductsAttributeList()
    {
        $saleProducts = SaleProductQuery::create()->filterBySaleId($this->getId())->orderByProductId()->find();

        $selectedAttributes = [];

        $currentProduct = false;

        /** @var SaleProduct $saleProduct */
        foreach ($saleProducts as $saleProduct) {
            if ($currentProduct != $saleProduct->getProductId()) {
                $currentProduct = $saleProduct->getProductId();

                $selectedAttributes[$currentProduct] = [];
            }

            $selectedAttributes[$currentProduct][] = $saleProduct->getAttributeAvId();
        }

        return $selectedAttributes;
    }
public function getSaleProductsAttributeList()
    {
        $saleProducts = SaleProductQuery::create()->filterBySaleId($this->getId())->orderByProductId()->find();

        $selectedAttributes = [];

        $currentProduct = false;

        /** @var SaleProduct $saleProduct */
        foreach ($saleProducts as $saleProduct) {
            if ($currentProduct != $saleProduct->getProductId()) {
                $currentProduct = $saleProduct->getProductId();

                $selectedAttributes[$currentProduct] = [];
            }

            $selectedAttributes[$currentProduct][] = $saleProduct->getAttributeAvId();
        }

        return $selectedAttributes;
    }
public function getSaleProductsAttributeList ( ) { $ saleProducts = SaleProductQuery :: create ( ) -> filterBySaleId ( $ this -> getId ( ) ) -> orderByProductId ( ) -> find ( ) ; $ selectedAttributes = [ ] ; $ currentProduct = false ; /** @var SaleProduct $saleProduct */ foreach ( $ saleProducts as $ saleProduct ) { if ( $ currentProduct != $ saleProduct -> getProductId ( ) ) { $ currentProduct = $ saleProduct -> getProductId ( ) ; $ selectedAttributes [ $ currentProduct ] = [ ] ; } $ selectedAttributes [ $ currentProduct ] [ ] = $ saleProduct -> getAttributeAvId ( ) ; } return $ selectedAttributes ; }
Return the selected attributes values for each of the selected products.

@return array an array of (product ID => array of attribute availability ID)
Return the selected attributes values for each of the selected products .