Automattic\WooCommerce\Admin\Features\ProductBlockEditor

ProductTemplate::__construct()publicWC 1.0

ProductTemplate constructor

Method of the class: ProductTemplate{}

No Hooks.

Return

null. Nothing (null).

Usage

$ProductTemplate = new ProductTemplate();
$ProductTemplate->__construct( $data );
$data(array) (required)
The data.

ProductTemplate::__construct() code WC 9.0.1

public function __construct( array $data ) {
	$this->id           = $data['id'];
	$this->title        = $data['title'];
	$this->product_data = $data['product_data'];

	if ( isset( $data['order'] ) ) {
		$this->order = $data['order'];
	}

	if ( isset( $data['layout_template_id'] ) ) {
		$this->layout_template_id = $data['layout_template_id'];
	}

	if ( isset( $data['description'] ) ) {
		$this->description = $data['description'];
	}

	if ( isset( $data['icon'] ) ) {
		$this->icon = $data['icon'];
	}

	if ( isset( $data['is_selectable_by_user'] ) ) {
		$this->is_selectable_by_user = $data['is_selectable_by_user'];
	}
}