Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Test
Unit
Interception
Sample
Plugin1.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Test\Unit\Interception\Sample
;
7
11
class
Plugin1
12
{
18
public
function
beforeDoSomething
(
Entity
$subject)
19
{
20
$subject->
addPluginCall
(static::class .
'::'
. __FUNCTION__);
21
//Not changing arguments
22
}
23
31
public
function
aroundDoSomething
(
Entity
$subject, \Closure $proceed)
32
{
33
$subject->
addPluginCall
(static::class .
'::'
. __FUNCTION__);
34
//Not breaking the chain
35
return
$proceed();
36
}
37
45
public
function
afterDoSomething
(
Entity
$subject,
$result
)
46
{
47
$subject->
addPluginCall
(static::class .
'::'
. __FUNCTION__);
48
//Not changing result
49
return
$result
;
50
}
51
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\Test\Unit\Interception\Sample\Entity
Definition:
Entity.php:11
Magento\Framework\Test\Unit\Interception\Sample\Entity\addPluginCall
addPluginCall($call)
Definition:
Entity.php:46
Magento\Framework\Test\Unit\Interception\Sample\Plugin1\afterDoSomething
afterDoSomething(Entity $subject, $result)
Definition:
Plugin1.php:45
Magento\Framework\Test\Unit\Interception\Sample\Plugin1
Definition:
Plugin1.php:11
Magento\Framework\Test\Unit\Interception\Sample\Plugin1\beforeDoSomething
beforeDoSomething(Entity $subject)
Definition:
Plugin1.php:18
Magento\Framework\Test\Unit\Interception\Sample
Definition:
Entity.php:6
Magento\Framework\Test\Unit\Interception\Sample\Plugin1\aroundDoSomething
aroundDoSomething(Entity $subject, \Closure $proceed)
Definition:
Plugin1.php:31