PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 2.1.5
JetFormBuilder — Dynamic Blocks Form Builder v2.1.5
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 3 years ago events 3 years ago methods 3 years ago types 3 years ago action-handler.php 3 years ago action-localize.php 3 years ago events-list.php 3 years ago events-manager.php 3 years ago manager.php 3 years ago
events-list.php
53 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 class Events_List extends Collection {
12
13 public static function create( array $events ): Events_List {
14 $collection = new Events_List();
15 foreach ( $events as $event ) {
16 $collection->push( $event );
17 }
18
19 return $collection;
20 }
21
22 public function push( $event ): Events_List {
23 if ( $event instanceof Base_Event ) {
24 return $this->add( $event );
25 }
26
27 try {
28 $item = Events_Manager::instance()->rep_get_item( $event );
29 } catch ( Repository_Exception $exception ) {
30 return $this;
31 }
32
33 return $this->add( $item );
34 }
35
36 public function in_array( $state ): bool {
37 if ( ! ( $state instanceof Base_Executor ) ) {
38 return parent::in_array( $state );
39 }
40 $executor_name = get_class( $state );
41
42 /** @var Base_Event $event */
43 foreach ( $this as $event ) {
44 if ( ! in_array( $executor_name, $event->ignored_executors(), true ) ) {
45 return parent::in_array( $state->get_event() );
46 }
47 }
48
49 return 0 !== count( $this );
50 }
51
52 }
53