BlockContainerInterface.php
2 years ago
BlockInterface.php
2 years ago
BlockTemplateInterface.php
2 years ago
ContainerInterface.php
2 years ago
ContainerInterface.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Admin\BlockTemplates; |
| 4 | |
| 5 | /** |
| 6 | * Interface for block containers. |
| 7 | */ |
| 8 | interface ContainerInterface { |
| 9 | /** |
| 10 | * Get the root template that the block belongs to. |
| 11 | */ |
| 12 | public function &get_root_template(): BlockTemplateInterface; |
| 13 | |
| 14 | /** |
| 15 | * Get the block configuration as a formatted template. |
| 16 | */ |
| 17 | public function get_formatted_template(): array; |
| 18 | |
| 19 | /** |
| 20 | * Get a block by ID. |
| 21 | * |
| 22 | * @param string $block_id The block ID. |
| 23 | */ |
| 24 | public function get_block( string $block_id ): ?BlockInterface; |
| 25 | |
| 26 | /** |
| 27 | * Removes a block from the container. |
| 28 | * |
| 29 | * @param string $block_id The block ID. |
| 30 | * |
| 31 | * @throws \UnexpectedValueException If the block container is not an ancestor of the block. |
| 32 | */ |
| 33 | public function remove_block( string $block_id ); |
| 34 | |
| 35 | /** |
| 36 | * Removes all blocks from the container. |
| 37 | */ |
| 38 | public function remove_blocks(); |
| 39 | } |
| 40 |