private function searchPromotions(array $codes, SalesChannelContext $context): array
    {
        /* @var PromotionCollection $codePromotions */
        $codePromotions = $this->promotionGateway->getByCodes($codes, $context);

        /** @var PromotionCollection $automaticPromotions */
        $automaticPromotions = $this->promotionGateway->getAutomaticPromotions($context);

        /** @var array $listPromotionsAdded */
        $listPromotionsAdded = $codePromotions->getElements();

        /** @var array $listPromotionsAutomatic */
        $listPromotionsAutomatic = $automaticPromotions->getElements();

        return array_merge($listPromotionsAdded, $listPromotionsAutomatic);
    }
private function searchPromotions(array $codes, SalesChannelContext $context): array
    {
        /* @var PromotionCollection $codePromotions */
        $codePromotions = $this->promotionGateway->getByCodes($codes, $context);

        /** @var PromotionCollection $automaticPromotions */
        $automaticPromotions = $this->promotionGateway->getAutomaticPromotions($context);

        /** @var array $listPromotionsAdded */
        $listPromotionsAdded = $codePromotions->getElements();

        /** @var array $listPromotionsAutomatic */
        $listPromotionsAutomatic = $automaticPromotions->getElements();

        return array_merge($listPromotionsAdded, $listPromotionsAutomatic);
    }
private function searchPromotions ( array $ codes , SalesChannelContext $ context ) : array { /* @var PromotionCollection $codePromotions */ $ codePromotions = $ this -> promotionGateway -> getByCodes ( $ codes , $ context ) ; /** @var PromotionCollection $automaticPromotions */ $ automaticPromotions = $ this -> promotionGateway -> getAutomaticPromotions ( $ context ) ; /** @var array $listPromotionsAdded */ $ listPromotionsAdded = $ codePromotions -> getElements ( ) ; /** @var array $listPromotionsAutomatic */ $ listPromotionsAutomatic = $ automaticPromotions -> getElements ( ) ; return array_merge ( $ listPromotionsAdded , $ listPromotionsAutomatic ) ; }
Gets a combination of all promotion objects that
are valid due to automatic promotions or that have
been manually added by using their codes.
Gets a combination of all promotion objects that are valid due to automatic promotions or that have been manually added by using their codes .