ProductTemplate
in package
Removed product editor product template value object.
Tags
Table of Contents
- $removal_warning_logged : bool
- Whether the removal warning has already been logged for the current request.
- __construct() : mixed
- Constructor.
- get_description() : string|null
- Get the template description.
- get_icon() : string|null
- Get the template icon.
- get_id() : string
- Get the template ID.
- get_is_selectable_by_user() : bool
- Get the selectable attribute.
- get_layout_template_id() : string|null
- Get the layout template ID.
- get_order() : int
- Get the template order.
- get_product_data() : array<string|int, mixed>
- Get the product data.
- get_title() : string
- Get the template title.
- set_description() : void
- Set the template description.
- set_icon() : void
- Set the template icon.
- set_layout_template_id() : void
- Set the layout template ID.
- set_order() : void
- Set the template order.
- to_json() : array<string|int, mixed>
- Get the product template as JSON-like data.
- maybe_log_removal_warning() : void
- Log a warning about the removed compatibility class.
Properties
$removal_warning_logged
Whether the removal warning has already been logged for the current request.
private
static bool
$removal_warning_logged
= false
Methods
__construct()
Constructor.
public
__construct(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
Template data.
Return values
mixed —get_description()
Get the template description.
public
get_description() : string|null
Return values
string|null —get_icon()
Get the template icon.
public
get_icon() : string|null
Return values
string|null —get_id()
Get the template ID.
public
get_id() : string
Return values
string —get_is_selectable_by_user()
Get the selectable attribute.
public
get_is_selectable_by_user() : bool
Return values
bool —get_layout_template_id()
Get the layout template ID.
public
get_layout_template_id() : string|null
Return values
string|null —get_order()
Get the template order.
public
get_order() : int
Return values
int —get_product_data()
Get the product data.
public
get_product_data() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_title()
Get the template title.
public
get_title() : string
Return values
string —set_description()
Set the template description.
public
set_description(string $description) : void
Parameters
- $description : string
-
The template description.
Return values
void —set_icon()
Set the template icon.
public
set_icon(string $icon) : void
Parameters
- $icon : string
-
The icon name or an external image URL.
Return values
void —set_layout_template_id()
Set the layout template ID.
public
set_layout_template_id(string $layout_template_id) : void
Parameters
- $layout_template_id : string
-
The layout template ID.
Return values
void —set_order()
Set the template order.
public
set_order(int $order) : void
Parameters
- $order : int
-
The template order.
Return values
void —to_json()
Get the product template as JSON-like data.
public
to_json() : array<string|int, mixed>
Return values
array<string|int, mixed> —maybe_log_removal_warning()
Log a warning about the removed compatibility class.
private
static maybe_log_removal_warning() : void
