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
functions.php
50 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Blocks\Conditional_Block; |
| 5 | |
| 6 | |
| 7 | use Jet_Form_Builder\Blocks\Conditional_Block\Functions\Base_Function; |
| 8 | use Jet_Form_Builder\Blocks\Conditional_Block\Functions\Function_Hide; |
| 9 | use Jet_Form_Builder\Blocks\Conditional_Block\Functions\Function_Set_Value; |
| 10 | use Jet_Form_Builder\Blocks\Conditional_Block\Functions\Function_Show; |
| 11 | use Jet_Form_Builder\Classes\Arrayable\Array_Tools; |
| 12 | use Jet_Form_Builder\Classes\Arrayable\Arrayable; |
| 13 | use Jet_Form_Builder\Classes\Repository\Repository_Pattern_Trait; |
| 14 | use Jet_Form_Builder\Exceptions\Repository_Exception; |
| 15 | |
| 16 | class Functions implements Arrayable { |
| 17 | |
| 18 | use Repository_Pattern_Trait; |
| 19 | |
| 20 | public function __construct() { |
| 21 | $this->rep_install(); |
| 22 | } |
| 23 | |
| 24 | public function rep_instances(): array { |
| 25 | return apply_filters( |
| 26 | 'jet-form-builder/conditional-block/functions', |
| 27 | array( |
| 28 | new Function_Hide(), |
| 29 | new Function_Show(), |
| 30 | new Function_Set_Value(), |
| 31 | ) |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @param string $slug |
| 37 | * |
| 38 | * @throws Repository_Exception |
| 39 | */ |
| 40 | public function isset_function( string $slug ) { |
| 41 | $this->rep_throw_if_undefined( $slug ); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @return array |
| 46 | */ |
| 47 | public function to_array(): array { |
| 48 | return Array_Tools::to_array( $this->rep_get_items() ); |
| 49 | } |
| 50 | } |