scenario-logic-base.php
2 years ago
scenario-logic-repository.php
2 years ago
scenario-view-base.php
2 years ago
scenarios-manager-abstract.php
2 years ago
scenarios-view-repository.php
2 years ago
scenario-view-base.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace JFB_Modules\Gateways\Scenarios_Abstract; |
| 5 | |
| 6 | use JFB_Modules\Gateways\Paypal\Scenarios_Manager; |
| 7 | use JFB_Modules\Gateways\Scenario_Item; |
| 8 | |
| 9 | // If this file is called directly, abort. |
| 10 | if ( ! defined( 'WPINC' ) ) { |
| 11 | die; |
| 12 | } |
| 13 | |
| 14 | abstract class Scenario_View_Base implements Scenario_Item { |
| 15 | |
| 16 | abstract public function get_title(): string; |
| 17 | |
| 18 | public static function rep_item_id() { |
| 19 | return static::scenario_id(); |
| 20 | } |
| 21 | |
| 22 | public function get_editor_labels(): array { |
| 23 | return array(); |
| 24 | } |
| 25 | |
| 26 | public function get_editor_data(): array { |
| 27 | return array(); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * @param $slug |
| 32 | * |
| 33 | * @return Scenario_View_Base |
| 34 | */ |
| 35 | protected function get_another( $slug ): Scenario_View_Base { |
| 36 | return Scenarios_Manager::instance()->view()->rep_get_item_or_die( $slug ); |
| 37 | } |
| 38 | |
| 39 | } |
| 40 |