/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Pricing/PriceInfo/Base.php
88 строк
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2014 Adobe * All Rights Reserved. */ namespace Magento\Framework\Pricing\PriceInfo; use Magento\Framework\Pricing\Adjustment\AdjustmentInterface; use Magento\Framework\Pricing\Adjustment\Collection; use Magento\Framework\Pricing\Price\Collection as PriceCollection; use Magento\Framework\Pricing\Price\PriceInterface; use Magento\Framework\Pricing\PriceInfoInterface; /** * Class Base * Price info base model * * @api * @since 100.0.2 */ class Base implements PriceInfoInterface { /** * @var PriceCollection */ protected $priceCollection; /** * @var Collection */ protected $adjustmentCollection; /** * @param PriceCollection $prices * @param Collection $adjustmentCollection */ public function __construct( PriceCollection $prices, Collection $adjustmentCollection ) { $this->adjustmentCollection = $adjustmentCollection; $this->priceCollection = $prices; } /** * Returns array of prices * * @return PriceCollection */ public function getPrices() { return $this->priceCollection; } /** * Returns price by code * * @param string $priceCode * @return PriceInterface */ public function getPrice($priceCode) { return $this->priceCollection->get($priceCode); } /** * Get all registered adjustments * * @return AdjustmentInterface[] */ public function getAdjustments() { return $this->adjustmentCollection->getItems(); } /** * Get adjustment by code * * @param string $adjustmentCode * @throws \InvalidArgumentException * @return AdjustmentInterface */ public function getAdjustment($adjustmentCode) { return $this->adjustmentCollection->getItemByCode($adjustmentCode); } }