AbstractBlock.php
4 weeks ago
AbstractBlockTemplate.php
2 years ago
Block.php
2 years ago
BlockContainerTrait.php
4 weeks ago
BlockFormattedTemplateTrait.php
2 years ago
BlockTemplate.php
2 years ago
BlockTemplateLogger.php
2 years ago
Block.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Internal\Admin\BlockTemplates; |
| 4 | |
| 5 | use Automattic\WooCommerce\Admin\BlockTemplates\BlockContainerInterface; |
| 6 | use Automattic\WooCommerce\Admin\BlockTemplates\BlockInterface; |
| 7 | use Automattic\WooCommerce\Admin\BlockTemplates\BlockTemplateInterface; |
| 8 | |
| 9 | /** |
| 10 | * Generic block with container properties to be used in BlockTemplate. |
| 11 | */ |
| 12 | class Block extends AbstractBlock implements BlockContainerInterface { |
| 13 | use BlockContainerTrait; |
| 14 | |
| 15 | /** |
| 16 | * Add an inner block to this block. |
| 17 | * |
| 18 | * @param array $block_config The block data. |
| 19 | */ |
| 20 | public function &add_block( array $block_config ): BlockInterface { |
| 21 | $block = new Block( $block_config, $this->get_root_template(), $this ); |
| 22 | return $this->add_inner_block( $block ); |
| 23 | } |
| 24 | } |
| 25 |