| 1 |
<?php |
| 2 |
declare(strict_types=1); |
| 3 |
|
| 4 |
namespace Imagify\Admin; |
| 5 |
|
| 6 |
use Imagify\EventManagement\SubscriberInterface; |
| 7 |
use Imagify\Dependencies\WPMedia\PluginFamily\Controller\{ PluginFamily, PluginFamilyInterface }; |
| 8 |
|
| 9 |
/** |
| 10 |
* Process plugin family actions. |
| 11 |
*/ |
| 12 |
class PluginFamilySubscriber implements SubscriberInterface, PluginFamilyInterface { |
| 13 |
|
| 14 |
/** |
| 15 |
* PluginFamily instance. |
| 16 |
* |
| 17 |
* @var PluginFamily |
| 18 |
*/ |
| 19 |
protected $plugin_family; |
| 20 |
|
| 21 |
/** |
| 22 |
* Instantiate the class |
| 23 |
* |
| 24 |
* @param PluginFamily $plugin_family PluginFamily instance. |
| 25 |
*/ |
| 26 |
public function __construct( PluginFamily $plugin_family ) { |
| 27 |
$this->plugin_family = $plugin_family; |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Returns an array of events this subscriber listens to |
| 32 |
* |
| 33 |
* @return array |
| 34 |
*/ |
| 35 |
public static function get_subscribed_events() { |
| 36 |
$events = PluginFamily::get_subscribed_events(); |
| 37 |
|
| 38 |
return $events; |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Process to install & activate plugin. |
| 43 |
* |
| 44 |
* @return void |
| 45 |
*/ |
| 46 |
public function install_activate() { |
| 47 |
$this->plugin_family->install_activate(); |
| 48 |
} |
| 49 |
|
| 50 |
/** |
| 51 |
* Display error notice if available. |
| 52 |
* |
| 53 |
* @return void |
| 54 |
*/ |
| 55 |
public function display_error_notice() { |
| 56 |
$this->plugin_family->display_error_notice(); |
| 57 |
} |
| 58 |
} |
| 59 |
|