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 / blocks / conditional-block / operators.php
jetformbuilder / includes / blocks / conditional-block Last commit date
functions 3 years ago operators 3 years ago render-states 3 years ago condition-item.php 3 years ago condition-manager.php 3 years ago condition-response-object.php 3 years ago functions.php 3 years ago operators.php 3 years ago render-state.php 3 years ago render-states-collection.php 3 years ago
operators.php
72 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Blocks\Conditional_Block;
5
6
7 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Base_Operator;
8 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Between;
9 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Contain;
10 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Equal;
11 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Render_State;
12 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Greater;
13 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_In_The_List;
14 use Jet_Form_Builder\Blocks\Conditional_Block\Operators\Operator_Less;
15 use Jet_Form_Builder\Classes\Arrayable\Array_Tools;
16 use Jet_Form_Builder\Classes\Arrayable\Arrayable;
17 use Jet_Form_Builder\Classes\Repository\Repository_Pattern_Trait;
18 use Jet_Form_Builder\Exceptions\Repository_Exception;
19
20 class Operators implements Arrayable {
21
22 use Repository_Pattern_Trait;
23
24 public function __construct() {
25 $this->rep_install();
26 }
27
28 /**
29 * @return array
30 */
31 public function rep_instances(): array {
32 $operators = array(
33 new Operator_Equal(),
34 new Operator_Greater(),
35 new Operator_Less(),
36 new Operator_Between(),
37 new Operator_In_The_List(),
38 new Operator_Contain(),
39 );
40
41 if ( Render_State::instance()->is_multiple() ) {
42 $operators[] = new Operator_Render_State();
43 }
44
45 return apply_filters(
46 'jet-form-builder/conditional-block/operators',
47 $operators
48 );
49 }
50
51 /**
52 * @param string $slug
53 *
54 * @throws Repository_Exception
55 */
56 public function isset_operator( string $slug ) {
57 $this->rep_throw_if_undefined( $slug );
58 }
59
60 /**
61 * @param string $slug
62 *
63 * @return Base_Operator
64 */
65 public function get_operator( string $slug ): Base_Operator {
66 return $this->rep_get_item_or_die( $slug );
67 }
68
69 public function to_array(): array {
70 return Array_Tools::to_array( $this->rep_get_items() );
71 }
72 }