PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.6
JetFormBuilder — Dynamic Blocks Form Builder v3.1.6
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-list.php
jetformbuilder / includes / actions Last commit date
conditions 2 years ago events 2 years ago methods 2 years ago types 2 years ago action-handler.php 2 years ago action-localize.php 2 years ago actions-tools.php 2 years ago events-list.php 2 years ago events-manager.php 2 years ago legacy-request-data.php 2 years ago manager.php 2 years ago send-email-hooks.php 2 years ago
events-list.php
58 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Actions;
5
6 use Jet_Form_Builder\Actions\Events\Base_Event;
7 use Jet_Form_Builder\Actions\Events\Base_Executor;
8 use Jet_Form_Builder\Classes\Arrayable\Collection;
9 use Jet_Form_Builder\Exceptions\Repository_Exception;
10
11 // If this file is called directly, abort.
12 if ( ! defined( 'WPINC' ) ) {
13 die;
14 }
15
16 class Events_List extends Collection {
17
18 public static function create( array $events ): Events_List {
19 $collection = new Events_List();
20 foreach ( $events as $event ) {
21 $collection->push( $event );
22 }
23
24 return $collection;
25 }
26
27 public function push( $event ): Events_List {
28 if ( $event instanceof Base_Event ) {
29 return $this->add( $event );
30 }
31
32 try {
33 $item = Events_Manager::instance()->rep_clone_item( $event );
34 } catch ( Repository_Exception $exception ) {
35 return $this->add( Events_Manager::instance()->get_never_event() );
36 }
37
38 return $this->add( $item );
39 }
40
41 public function in_array( $state ): bool {
42 if ( ! ( $state instanceof Base_Executor ) ) {
43 return parent::in_array( $state );
44 }
45 $executor_name = get_class( $state );
46
47 /** @var Base_Event $event */
48 foreach ( $this as $event ) {
49 if ( ! in_array( $executor_name, $event->ignored_executors(), true ) ) {
50 return parent::in_array( $state->get_event() );
51 }
52 }
53
54 return 0 !== count( $this );
55 }
56
57 }
58