Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Plugin1.php
Go to the documentation of this file.
1 <?php
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 }
aroundDoSomething(Entity $subject, \Closure $proceed)
Definition: Plugin1.php:31