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 / base-operator.php

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

53 lines 1.1 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\Operators;
5
6 use Jet_Form_Builder\Blocks\Conditional_Block\Condition_Response_Object;
7 use Jet_Form_Builder\Blocks\Conditional_Block\Condition_Types\Base_Condition_Type;
8 use Jet_Form_Builder\Classes\Arrayable\Arrayable;
9 use JFB_Components\Repository\Repository_Item_Instance_Trait;
10
11 // If this file is called directly, abort.
12 if ( ! defined( 'WPINC' ) ) {
13 die;
14 }
15
16 abstract class Base_Operator implements
17 Repository_Item_Instance_Trait,
18 Arrayable,
19 Condition_Response_Object {
20
21 abstract public function get_id(): string;
22
23 abstract public function get_title(): string;
24
25 abstract public function is_supported(): bool;
26
27 public function rep_item_id() {
28 return $this->get_id();
29 }
30
31 protected function check( Base_Condition_Type $item ): bool {
32 return true;
33 }
34
35 public function to_response( array $base, Base_Condition_Type $item ): array {
36 if ( ! $this->is_supported() ) {
37 return array();
38 }
39
40 return array(
41 'check_result' => $this->check( $item ),
42 );
43 }
44
45 public function to_array(): array {
46 return array(
47 'label' => $this->get_title(),
48 'value' => $this->get_id(),
49 );
50 }
51
52 }
53