PackageOptionConditionSets extends AppModel
Package Option Condition Set management
Table of Contents
Methods
| __construct() | Initialize PackageOptionConditionSets |
| add() | Adds a package option condition set |
| appendDetails() | Appends addition details to a condition set object |
| delete() | Permanently removes a package option condition set from the system |
| edit() | Updates a package option |
| get() | Fetches the package option condition set |
| getAll() | Fetches all package option condition sets |
| getRules() | Retrieves a list of rules for adding/editing package option condition sets |
| getSets() | Partially-constructs the Record object for fetching package option condition sets |
Methods
__construct()
Initialize PackageOptionConditionSets
public
__construct() : mixed
add()
Adds a package option condition set
public
add(array<string|int, mixed> $vars) : int
Parameters
- $vars : array<string|int, mixed>
-
An array of package option condition set info including:
- option_group_id The ID of the option group this condition set is for
- option_id The ID of the option this condition set is for
- option_value_ids The ID of the package option values for the set (optional)
Return values
int —The package option condition set ID, void on error
appendDetails()
Appends addition details to a condition set object
public
appendDetails(stdClass $set) : stdClass
Parameters
- $set : stdClass
-
The condition set object
Return values
stdClass —The updated condition set object
delete()
Permanently removes a package option condition set from the system
public
delete(int $set_id) : mixed
Parameters
- $set_id : int
-
The package option condition set ID to delete
edit()
Updates a package option
public
edit(int $set_id, array<string|int, mixed> $vars) : int
Parameters
- $set_id : int
-
The ID of the package option condition set to update
- $vars : array<string|int, mixed>
-
An array of package option condition set info including:
- option_group_id The ID of the option group this condition set is for
- option_id The ID of the option this condition set is for
- option_value_ids The ID of the package option values for the set
Return values
int —The package option condition set ID, void on error
get()
Fetches the package option condition set
public
get(int $set_id) : mixed
Parameters
- $set_id : int
-
The ID of the package option condition set to fetch
Tags
Return values
mixed —A stdClass object representing the option condition set, false if no such set exists
getAll()
Fetches all package option condition sets
public
getAll([array<string|int, mixed> $filters = [] ]) : array<string|int, mixed>
Parameters
- $filters : array<string|int, mixed> = []
-
A list of filters:
- id The ID of the package option condition set
- option_group_id The ID of the package option group for the set
- option_id The ID of the package option for the set
- option_ids The IDs of the package options by which to filter the sets
- package_id The ID of the package for the set
Tags
Return values
array<string|int, mixed> —An array of stdClass objects representing each package option condition
getRules()
Retrieves a list of rules for adding/editing package option condition sets
private
getRules(array<string|int, mixed> $vars[, bool $edit = false ]) : array<string|int, mixed>
Parameters
- $vars : array<string|int, mixed>
-
A list of input vars used in validation
- id The ID of the package option condition set
- option_group_id The ID of the package option group for the set
- option_id The ID of the package option for the set
- option_value_ids The ID of the package option values for the set
- $edit : bool = false
-
True to fetch the edit rules, false for the add rules (optional, default false)
Return values
array<string|int, mixed> —A list of rules
getSets()
Partially-constructs the Record object for fetching package option condition sets
private
getSets([array<string|int, mixed> $filters = [] ][, bool $select = true ]) : Record
Parameters
- $filters : array<string|int, mixed> = []
-
A list of filters:
- id The ID of the package option condition set
- option_group_id The ID of the package option group for the set
- option_id The ID of the package option for the set
- option_ids The IDs of the package options by which to filter the sets
- package_id The ID of the package for the set
- $select : bool = true
-
Whether to select field in the query
Return values
Record —A partially-constructed Record object