Created
January 30, 2020 11:32
-
-
Save MintayRibkins/da786a6c13ff74af129c70b60b002c94 to your computer and use it in GitHub Desktop.
Module Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
namespace Hrytsenko\PluginExample\Plugin; | |
use Magento\Catalog\Api\ProductRepositoryInterface; | |
use Psr\Log\LoggerInterface; | |
class ProductRepositoryExamplePlugin | |
{ | |
public function __construct(LoggerInterface $logger) | |
{ | |
$this->logger = $logger; | |
} | |
public function beforeGetById( | |
ProductRepositoryInterface $subject, | |
$productId, | |
$editMode = false, | |
$storeId = null, | |
$forceReload = false | |
) { | |
$this->logger->info('Before get product by ID' . $productId); | |
return [$productId, $editMode, $storeId, $forceReload]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment