![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-quote/Model/Quote/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Quote\Model\Quote; use Magento\Quote\Model\Quote\Address\Total\Collector; use Magento\Quote\Model\Quote\Address\Total\CollectorFactory; use Magento\Quote\Model\Quote\Address\Total\CollectorInterface; class TotalsCollectorList { /** * Total models collector * * @var \Magento\Quote\Model\Quote\Address\Total\Collector */ protected $totalCollector; /** * @var \Magento\Quote\Model\Quote\Address\Total\CollectorFactory */ protected $totalCollectorFactory; /** * Prefix of model events * * @var string */ protected $_eventPrefix = 'sales_quote_address'; /** * Name of event object * * @var string */ protected $_eventObject = 'quote_address'; /** * Application Event Dispatcher * * @var \Magento\Framework\Event\ManagerInterface */ protected $eventManager; /** * @var \Magento\Store\Model\StoreManagerInterface */ protected $storeManager; /** * @var \Magento\Quote\Model\Quote\Address\TotalFactory */ protected $totalFactory; /** * @param Collector $totalCollector * @param CollectorFactory $totalCollectorFactory * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param Address\TotalFactory $totalFactory */ public function __construct( Collector $totalCollector, CollectorFactory $totalCollectorFactory, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Quote\Model\Quote\Address\TotalFactory $totalFactory ) { $this->totalCollector = $totalCollector; $this->totalCollectorFactory = $totalCollectorFactory; $this->eventManager = $eventManager; $this->storeManager = $storeManager; $this->totalFactory = $totalFactory; } /** * @param int $storeId * @return Collector */ private function getTotalCollector($storeId) { if ($this->totalCollector === null) { $store = $this->storeManager->getStore($storeId); $this->totalCollector = $this->totalCollectorFactory->create( ['store' => $store] ); } return $this->totalCollector; } /** * @param int $storeId * @return \Magento\Quote\Model\Quote\Address\Total\AbstractTotal[] */ public function getCollectors($storeId) { return $this->getTotalCollector($storeId)->getCollectors(); } }