<?php

namespace Autogedal\Extend\Block;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\DataObject;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\View\Element\Template\Context;
use Magento\Sales\Model\Order;
use Magento\Sales\Model\Order\Config;
use Magento\Store\Model\Information;

class Guest extends \Netopia\Netcard\Block\Guest
{
    /**
     * @var Information
     */
    private $_storeInfo;
    public function __construct(
        Context $context,
        Order $orderFactory,
        \Magento\Framework\App\Http\Context $httpContext,
        Config $orderConfig,
        array $data,
        Information $storeInfo = null
    ){
        parent::__construct($context, $orderFactory, $httpContext, $orderConfig, $data);
        $this->_storeInfo = $storeInfo ?? ObjectManager::getInstance()->get(Information::class);
    }

    /**
     * @return DataObject
     * @throws NoSuchEntityException
     */
    public function getStoreInfo(): DataObject
    {
        $store            = $this->_storeManager->getStore();
        return $this->_storeInfo->getStoreInformationObject($store);
    }
}
