PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.4.2
JetFormBuilder — Dynamic Blocks Form Builder v3.6.4.2
3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / gateways / scenarios-abstract / scenarios-manager-abstract.php
jetformbuilder / modules / gateways / scenarios-abstract Last commit date
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
scenarios-manager-abstract.php
100 lines
1 <?php
2
3
4 namespace JFB_Modules\Gateways\Scenarios_Abstract;
5
6 use Jet_Form_Builder\Exceptions\Gateway_Exception;
7 use Jet_Form_Builder\Exceptions\Repository_Exception;
8 use JFB_Modules\Gateways\Base_Gateway;
9
10 // If this file is called directly, abort.
11 if ( ! defined( 'WPINC' ) ) {
12 die;
13 }
14
15 /**
16 * Class Actions_Manager
17 *
18 * @package JFB_Modules\Gateways\Paypal
19 */
20 abstract class Scenarios_Manager_Abstract {
21
22 const QUERY_VAR = 'jet_gateway_scenario';
23
24 private $queried_scenario;
25 // phpcs:disable PSR2.Classes.PropertyDeclaration.Underscore
26 private $_logic_manager;
27 private $_view_manager;
28 // phpcs:enable PSR2.Classes.PropertyDeclaration.Underscore
29
30 protected function __construct() {
31 $this->logic()->rep_install();
32 $this->view()->rep_install();
33 }
34
35 public function logic(): Scenario_Logic_Repository {
36 return $this->_logic_manager;
37 }
38
39 public function view(): Scenarios_View_Repository {
40 return $this->_view_manager;
41 }
42
43 protected function set_logic_manager( Scenario_Logic_Repository $manager ) {
44 $this->_logic_manager = $manager;
45
46 return $this;
47 }
48
49 protected function set_view_manager( Scenarios_View_Repository $manager ) {
50 $this->_view_manager = $manager;
51
52 return $this;
53 }
54
55 /**
56 * @param Base_Gateway $controller
57 *
58 * @return Scenario_Logic_Base
59 * @throws Repository_Exception
60 */
61 public function get_logic( Base_Gateway $controller ): Scenario_Logic_Base {
62 return $this->logic()->rep_get_item( $controller->get_current_scenario_id() );
63 }
64
65 /**
66 * @param $slug
67 *
68 * @return Scenario_View_Base
69 * @throws Repository_Exception
70 */
71 public function get_view( $slug ): Scenario_View_Base {
72 return $this->view()->get_view( $slug );
73 }
74
75 /**
76 * @return Scenario_Logic_Base
77 * @throws Gateway_Exception
78 */
79 public function query_logic(): Scenario_Logic_Base {
80 try {
81 if ( ! $this->queried_scenario ) {
82 $scenario = sanitize_text_field(
83 wp_unslash(
84 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
85 $_GET[ self::QUERY_VAR ] ?? ''
86 )
87 );
88
89 $this->queried_scenario = $this->logic()->rep_get_item( $scenario );
90 }
91 } catch ( Repository_Exception $exception ) {
92 throw new Gateway_Exception( esc_html( $exception->getMessage() ) );
93 }
94
95 return $this->queried_scenario;
96 }
97
98
99 }
100