default-process-event.php
2 years ago
default-process-executor.php
2 years ago
default-with-gateway-executor.php
2 years ago
default-process-executor.php
41 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Actions\Events\Default_Process; |
| 5 | |
| 6 | use Jet_Form_Builder\Actions\Events\Base_Executor; |
| 7 | use Jet_Form_Builder\Actions\Types\Base; |
| 8 | use Jet_Form_Builder\Actions\Types\Save_Record; |
| 9 | use Jet_Form_Builder\Exceptions\Action_Exception; |
| 10 | |
| 11 | // If this file is called directly, abort. |
| 12 | if ( ! defined( 'WPINC' ) ) { |
| 13 | die; |
| 14 | } |
| 15 | |
| 16 | class Default_Process_Executor extends Base_Executor { |
| 17 | |
| 18 | public function before_execute() { |
| 19 | do_action( 'jet-form-builder/actions/before-send' ); |
| 20 | |
| 21 | parent::before_execute(); |
| 22 | } |
| 23 | |
| 24 | public function after_execute() { |
| 25 | do_action( 'jet-form-builder/actions/after-send' ); |
| 26 | |
| 27 | parent::after_execute(); |
| 28 | } |
| 29 | |
| 30 | protected function is_valid_action( Base $action ): bool { |
| 31 | return ( ! count( $action->get_events() ) || parent::is_valid_action( $action ) ); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * @return bool |
| 36 | */ |
| 37 | public function is_supported(): bool { |
| 38 | return true; |
| 39 | } |
| 40 | } |
| 41 |