| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Modules\IntegrationActions; |
| 4 |
|
| 5 |
|
| 6 |
abstract class BaseIntegrationAction |
| 7 |
{ |
| 8 |
public string $slug; |
| 9 |
private static array $actions = []; |
| 10 |
|
| 11 |
public function __construct() |
| 12 |
{ |
| 13 |
|
| 14 |
} |
| 15 |
|
| 16 |
public function init() |
| 17 |
{ |
| 18 |
add_filter('fluent_cart/integration/get_global_integration_actions', function () { |
| 19 |
return $this->register(); |
| 20 |
}, 10, 1); |
| 21 |
|
| 22 |
$this->registerHooks(); |
| 23 |
} |
| 24 |
|
| 25 |
public function registerHooks() |
| 26 |
{ |
| 27 |
//This hook will allow others to register their storage driver with individual storage providers |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
public function register(): array |
| 32 |
{ |
| 33 |
static::$actions[] = [ |
| 34 |
"slug" => $this->getSlug(), |
| 35 |
'instance' => $this |
| 36 |
]; |
| 37 |
return static::$actions; |
| 38 |
} |
| 39 |
|
| 40 |
abstract public function handle(); |
| 41 |
|
| 42 |
abstract public function getSlug(): string; |
| 43 |
|
| 44 |
} |
| 45 |
|
| 46 |
|