advanced-rules
3 years ago
button-types
3 years ago
conditional-block
3 years ago
exceptions
3 years ago
modules
3 years ago
render
3 years ago
ssr-validation
3 years ago
types
3 years ago
validation-messages
3 years ago
action-buttons-manager.php
3 years ago
block-helper.php
3 years ago
blocks-repository-base.php
3 years ago
default-blocks-repository.php
3 years ago
dynamic-value.php
3 years ago
form-builder-blocks-repository.php
3 years ago
manager.php
3 years ago
switch-page-on-change.php
3 years ago
validation.php
3 years ago
blocks-repository-base.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Blocks; |
| 5 | |
| 6 | use Jet_Form_Builder\Classes\Repository\Repository_Pattern_Trait; |
| 7 | use Jet_Form_Builder\Exceptions\Repository_Exception; |
| 8 | |
| 9 | abstract class Blocks_Repository_Base { |
| 10 | |
| 11 | use Repository_Pattern_Trait; |
| 12 | |
| 13 | /** |
| 14 | * @param $block_type |
| 15 | * |
| 16 | * @throws Repository_Exception |
| 17 | */ |
| 18 | public function rep_before_install_item( $block_type ) { |
| 19 | /** @var Types\Base $block_type */ |
| 20 | |
| 21 | // throw exception & exclude from repository if block is not supported |
| 22 | if ( ! $block_type->is_supported() ) { |
| 23 | $this->_rep_abort_this(); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * @param $block_type |
| 29 | */ |
| 30 | public function rep_after_install_item( $block_type ) { |
| 31 | /** @var Types\Base $block_type */ |
| 32 | |
| 33 | $block_type->register_block_type(); |
| 34 | } |
| 35 | |
| 36 | } |
| 37 |