class CartItemOption implements Arrayable, Jsonable

Properties

int|string $id

The ID of the cart item option.

string $name

The name of the cart item option.

Collection $values

The values for this cart item option.

Methods

__construct(int|string $id, string $name, array $values = [])

CartItem constructor.

string
subtotal()

Returns the subtotal.

void
updateFromArray(array $attributes)

Update the cart item from an array.

static CartItemOption
fromArray(array $attributes)

Create a new instance from the given array.

makeCartOptionValues($values)

No description

array
toArray()

Get the instance as an array.

string
toJson(int $options = 0)

Convert the object to its JSON representation.

Details

at line 38
__construct(int|string $id, string $name, array $values = [])

CartItem constructor.

Parameters

int|string $id
string $name
array $values

at line 58
string subtotal()

Returns the subtotal.

Subtotal is price for whole CartItem with options

Return Value

string

at line 72
void updateFromArray(array $attributes)

Update the cart item from an array.

Parameters

array $attributes

Return Value

void

at line 86
static CartItemOption fromArray(array $attributes)

Create a new instance from the given array.

Parameters

array $attributes

Return Value

CartItemOption

at line 95
protected makeCartOptionValues($values)

No description

Parameters

$values

at line 110
array toArray()

Get the instance as an array.

Return Value

array

at line 126
string toJson(int $options = 0)

Convert the object to its JSON representation.

Parameters

int $options

Return Value

string