| 1 |
<?php |
| 2 |
namespace JFB_Modules\Validation; |
| 3 |
|
| 4 |
use JFB_Modules\Validation\Handlers\Ajax_Validation_Handler; |
| 5 |
use JFB_Modules\Validation\Handlers\Self_Validation_Handler; |
| 6 |
use JFB_Modules\Validation\Handlers\Validation_Handler; |
| 7 |
use JFB_Components\Repository\Repository_Pattern_Trait; |
| 8 |
use Jet_Form_Builder\Exceptions\Repository_Exception; |
| 9 |
|
| 10 |
if ( ! defined( 'WPINC' ) ) { |
| 11 |
die; |
| 12 |
} |
| 13 |
|
| 14 |
class Class_Validation_Handlers { |
| 15 |
|
| 16 |
use Repository_Pattern_Trait; |
| 17 |
|
| 18 |
public function __construct() { |
| 19 |
$this->rep_install(); |
| 20 |
} |
| 21 |
|
| 22 |
public function rep_instances(): array { |
| 23 |
return apply_filters( |
| 24 |
'jet-form-builder/validation-handlers', |
| 25 |
array( |
| 26 |
new Validation_Handler(), |
| 27 |
new Self_Validation_Handler(), |
| 28 |
new Ajax_Validation_Handler(), |
| 29 |
) |
| 30 |
); |
| 31 |
} |
| 32 |
|
| 33 |
public function get_handler( string $handler_id ) { |
| 34 |
return $this->rep_get_item( $handler_id ); |
| 35 |
} |
| 36 |
|
| 37 |
public function get_handlers(): array { |
| 38 |
return $this->rep_get_items(); |
| 39 |
} |
| 40 |
} |
| 41 |
|