Group extends Model Uses HasUniqueIdentifier
Representation of an individual group and it's options.
Tags
Table of Contents
- $fillable : array<string|int, mixed>
- Fields which can be mass assigned.
- $timestamps : mixed
- $attributes : array<string|int, mixed>
- Defaults
- $casts : array<string|int, mixed>
- Automatically cast attributes in specific ways.
- $primaryKey : mixed
- $table : mixed
- get_groups_by_product() : array<string|int, mixed>
- Get the groups for a particular product.
Properties
$fillable
Fields which can be mass assigned.
public
array<string|int, mixed>
$fillable
= ['name', 'display_name', 'menu_order', 'visibility', 'categories', 'exclude_categories', 'products', 'exclude_products']
Tags
$timestamps
public
mixed
$timestamps
= false
Tags
$attributes
Defaults
protected
array<string|int, mixed>
$attributes
= ['name' => '', 'menu_order' => 0, 'display_name' => 0, 'visibility' => 'global', 'categories' => 'null', 'exclude_categories' => 'null', 'products' => 'null', 'exclude_products' => 'null']
Tags
$casts
Automatically cast attributes in specific ways.
protected
array<string|int, mixed>
$casts
= ['products' => 'array', 'exclude_products' => 'array', 'categories' => 'array', 'exclude_categories' => 'array']
Tags
$primaryKey
protected
mixed
$primaryKey
= 'id'
Tags
$table
protected
mixed
$table
= \Barn2\Plugin\WC_Product_Options\Plugin::META_PREFIX . 'groups'
Tags
Methods
get_groups_by_product()
Get the groups for a particular product.
public
static get_groups_by_product(WC_Product $product) : array<string|int, mixed>
Parameters
- $product : WC_Product