PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 2.1.1
JetFormBuilder — Dynamic Blocks Form Builder v2.1.1
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 / includes / actions / events / base-event.php
jetformbuilder / includes / actions / events Last commit date
bad-request 3 years ago default-process 3 years ago default-required 3 years ago gateway-failed 3 years ago gateway-success 3 years ago base-action-event.php 3 years ago base-event.php 3 years ago base-executor.php 3 years ago base-gateway-event.php 3 years ago gateway-base-executor.php 3 years ago
base-event.php
85 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Actions\Events;
5
6 use Jet_Form_Builder\Actions\Types\Base;
7 use Jet_Form_Builder\Classes\Arrayable\Arrayable;
8 use Jet_Form_Builder\Classes\Arrayable\Collection_Item_Interface;
9 use Jet_Form_Builder\Classes\Repository\Repository_Item_Instance_Trait;
10 use Jet_Form_Builder\Exceptions\Action_Exception;
11
12 abstract class Base_Event implements
13 Repository_Item_Instance_Trait,
14 Collection_Item_Interface,
15 Arrayable {
16
17 /**
18 * @return Base_Executor[]
19 */
20 abstract public function executors(): array;
21
22 public function ignored_executors(): array {
23 return array();
24 }
25
26 /**
27 * @throws Action_Exception
28 */
29 final public function execute() {
30 $this->get_executor()->execute();
31 }
32
33
34 /**
35 * @return Base_Executor
36 */
37 final public function get_executor(): Base_Executor {
38 foreach ( $this->executors() as $executor ) {
39 if ( $executor->is_supported() ) {
40 return $executor->set_event( $this );
41 }
42 }
43
44 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
45 wp_die(
46 /* translators: %s - Event class name */
47 sprintf( __( 'Not founded supported executor for %s', 'jet-form-builder' ), static::class )
48 );
49 // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
50 }
51
52 public function is_valid_action( Base $action ): bool {
53 $unsupported = $action->unsupported_events();
54
55 if ( ! empty( $unsupported ) && in_array( static::class, $unsupported, true ) ) {
56 return false;
57 }
58 $supported = $action->supported_events();
59
60 if ( ! empty( $supported ) && ! in_array( static::class, $supported, true ) ) {
61 return false;
62 }
63
64 return $action->get_events()->in_array( $this );
65 }
66
67 public function get_label(): string {
68 return $this->get_id();
69 }
70
71 public function rep_item_id() {
72 return $this->get_id();
73 }
74
75
76 public function to_array(): array {
77 return array(
78 'value' => $this->get_id(),
79 'label' => $this->get_label(),
80 'self' => static::class,
81 );
82 }
83
84 }
85