PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.6
JetFormBuilder — Dynamic Blocks Form Builder v3.6.6
3.6.6.1 3.6.6 3.6.5.4 3.6.5.3 3.6.5.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 All 134 releases
jetformbuilder / includes / blocks / conditional-block / operators.php

operators.php in JetFormBuilder — Dynamic Blocks Form Builder 3.6.6, at includes/blocks/conditional-block/operators.php

90 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace Jet_Form_Builder\Blocks\Conditional_Block;
5
6 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Base_Operator;
7 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Between;
8 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Contain;
9 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Empty;
10 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Equal;
11 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Greater_Or_Equal;
12 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Less_Or_Equal;
13 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Not_Between;
14 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Not_Contain;
15 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Not_Empty;
16 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Not_Equal;
17 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Not_In_The_List;
18 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Render_State;
19 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Greater;
20 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_In_The_List;
21 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Less;
22 use Jet_Form_Builder\Classes\Arrayable\Array_Tools;
23 use Jet_Form_Builder\Classes\Arrayable\Arrayable;
24 use JFB_Components\Repository\Repository_Pattern_Trait;
25 use Jet_Form_Builder\Exceptions\Repository_Exception;
26
27 // If this file is called directly, abort.
28 if ( ! defined( 'WPINC' ) ) {
29 die;
30 }
31
32 class Operators implements Arrayable {
33
34 use Repository_Pattern_Trait;
35
36 public function __construct() {
37 $this->rep_install();
38 }
39
40 /**
41 * @return array
42 */
43 public function rep_instances(): array {
44 $operators = array(
45 new Operator_Equal(),
46 new Operator_Not_Equal(),
47 new Operator_Empty(),
48 new Operator_Not_Empty(),
49 new Operator_Greater(),
50 new Operator_Greater_Or_Equal(),
51 new Operator_Less(),
52 new Operator_Less_Or_Equal(),
53 new Operator_Between(),
54 new Operator_Not_Between(),
55 new Operator_In_The_List(),
56 new Operator_Not_In_The_List(),
57 new Operator_Contain(),
58 new Operator_Not_Contain(),
59 new Operator_Render_State(),
60 );
61
62 return apply_filters(
63 'jet-form-builder/conditional-block/operators',
64 $operators
65 );
66 }
67
68 /**
69 * @param string $slug
70 *
71 * @throws Repository_Exception
72 */
73 public function isset_operator( string $slug ) {
74 $this->rep_throw_if_undefined( $slug );
75 }
76
77 /**
78 * @param string $slug
79 *
80 * @return Base_Operator
81 */
82 public function get_operator( string $slug ): Base_Operator {
83 return $this->rep_get_item_or_die( $slug );
84 }
85
86 public function to_array(): array {
87 return Array_Tools::to_array( $this->rep_get_items() );
88 }
89 }
90