\CGProductBuilderoption_set

Define an option set.

An option set contains an id, name, description, and also contains a list of options. This class handles saving and loading objects of this type.

Summary

Methods
Properties
Constants
validate()
save()
load()
get_id_by_name()
load_all()
load_list()
copy()
delete()
has_options()
get_options()
set_options()
delete_options()
$name
$description
$id
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$name

$name : string

The option set name.

Type

string

$description

$description : string

A description for this option set (may include HTML)

Type

string

$id

$id : int

The option set id (a valid integer once saved to the database).

Type

int

Methods

validate()

validate()

Ensure that the contents of the option set are valid.

save()

save()

Save this option set to the database.

load()

load(int $id) : \CGProductBuilder\option_set

Load an option set from the database.

Parameters

int $id

The option set id.

Returns

\CGProductBuilder\option_set

get_id_by_name()

get_id_by_name( $name)

Parameters

$name

load_all()

load_all() : \CGProductBuilder\option_set[]

Load all option sets.

Returns

\CGProductBuilder\option_set[]

load_list()

load_list() : array

Generate a list (suitable for use in dropdowns) of all option sets.

Returns

array

copy()

copy()

Copy this option set

delete()

delete()

Delete this option set.

has_options()

has_options() : bool

Test if this option set has options.

Returns

bool

get_options()

get_options() : \CGProductBuilder\option[]

Get all of the options associated with this option set.

Returns

\CGProductBuilder\option[]

set_options()

set_options(\CGProductBuilder\option[] $options)

Set all of the options associated with this option set.

Parameters

\CGProductBuilder\option[] $options

delete_options()

delete_options()

Delete all of the options that are currently associated with this option set.