| 1 |
<?php namespace TierPricingTable\Addons\ReactProductEditorAddon; |
| 2 |
|
| 3 |
use Automattic\WooCommerce\Admin\Features\ProductBlockEditor\BlockRegistry; |
| 4 |
|
| 5 |
abstract class Block { |
| 6 |
|
| 7 |
abstract public function isCustomBlock(): bool; |
| 8 |
|
| 9 |
abstract public function getCustomBlockFolder(): ?string; |
| 10 |
|
| 11 |
abstract public function getBlockName(): string; |
| 12 |
|
| 13 |
abstract public function getSectionId(): string; |
| 14 |
|
| 15 |
abstract public function getOrder(): int; |
| 16 |
|
| 17 |
abstract public function getId(): string; |
| 18 |
|
| 19 |
public function wrapToPremium(): bool { |
| 20 |
return false; |
| 21 |
} |
| 22 |
|
| 23 |
abstract public function getAttributes(): array; |
| 24 |
|
| 25 |
public function register() { |
| 26 |
if ( $this->isCustomBlock() ) { |
| 27 |
BlockRegistry::get_instance()->register_block_type_from_metadata( $this->getCustomBlockFolder() ); |
| 28 |
} |
| 29 |
} |
| 30 |
} |
| 31 |
|