<?php
/******************************************************************************
 *   ______                                                                   *
 *  /       \                                                                 *
 * /$$$$$$  | ________  __    __   ______    ______                           *
 * $$ |__$$ |/        |/  |  /  | /      \  /      \                          *
 * $$    $$ |$$$$$$$$/ $$ |  $$ |/$$$$$$  |/$$$$$$  |                         *
 * $$$$$$$$ |  /  $$/  $$ |  $$ |$$ |  $$/ $$    $$ |                         *
 * $$ |  $$ | /$$$$/__ $$ \__$$ |$$ |      $$$$$$$$/                          *
 * $$ |  $$ |/$$      |$$    $$/ $$ |      $$       |                         *
 * $$/   $$/ $$$$$$$$/  $$$$$$/  $$/        $$$$$$$/                          *
 *                                                                            *
 * @PROJECT    : 3D Preview Extension [Magetop.com]                           *
 * @AUTHOR     : Azure - Developer                                            *
 * @COPYRIGHT  : © 2019  Magetop.com                                          *
 * @LINK       : https://Magetop.com                                          *
 * @CREATED    :  10/01/2022                                                  *
 ******************************************************************************/

namespace Magetop\Advancepreview\Plugin;


class ProductRepositoryPlugin
{
    protected $previewhistoryFactory;
    protected $resPreviewhistoryFactory;
    public function __construct(
        \Magetop\Advancepreview\Model\PreviewhistoryFactory $previewhistoryFactory,
        \Magetop\Advancepreview\Model\ResourceModel\PreviewhistoryFactory $resPreviewhistoryFactory
    )
    {
        $this->previewhistoryFactory = $previewhistoryFactory;
        $this->resPreviewhistoryFactory = $resPreviewhistoryFactory;
    }

    public function afterGet(\Magento\Catalog\Api\ProductRepositoryInterface $subject, $result) {
      /*  $this->previewhistoryFactory->create();
        $this->resPreviewhistoryFactory->create();*/
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/plugin.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('D ', $result->getId());
    }
}
