Automattic\WooCommerce\Internal\Features\ProductBlockEditor\ProductTemplates

Group::__constructpublicWC 1.0

Group Block constructor.

Method of the class: Group{}

No Hooks.

Returns

null. Nothing (null).

Usage

$Group = new Group();
$Group->__construct( $config, $root_template, ?ContainerInterface $parent );
$config(array) (required)
The block configuration.
$root_template(BlockTemplateInterface) (required)
The block template that this block belongs to.
?ContainerInterface $parent(passed by reference — &)
.
Default: null

Group::__construct() code WC 10.7.0

public function __construct( array $config, BlockTemplateInterface &$root_template, ?ContainerInterface &$parent = null ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.parentFound
	if ( ! empty( $config['blockName'] ) ) {
		throw new \InvalidArgumentException( 'Unexpected key "blockName", this defaults to "woocommerce/product-tab".' );
	}
	if ( $config['id'] && ( empty( $config['attributes'] ) || empty( $config['attributes']['id'] ) ) ) {
		$config['attributes']       = empty( $config['attributes'] ) ? array() : $config['attributes'];
		$config['attributes']['id'] = $config['id'];
	}
	parent::__construct( array_merge( array( 'blockName' => 'woocommerce/product-tab' ), $config ), $root_template, $parent );
}