OrderAffiliateSettings extends OrderModel
Order Affiliate Setting Management
Table of Contents
Methods
| getSetting() | Fetch a single setting by key name |
| getSettings() | Fetches all affiliate settings |
| setSetting() | Sets the setting with the given key, overwriting any existing value with that key |
| setSettings() | Sets a group of settings with key/value pairs |
| unsetSetting() | Unsets a setting from the order affiliate settings. |
| getRules() | Retrieves rules for adding a setting |
Methods
getSetting()
Fetch a single setting by key name
public
getSetting(int $affiliate_id, string $key) : mixed
Parameters
- $affiliate_id : int
-
The affiliate ID
- $key : string
-
The key name of the setting to fetch
Return values
mixed —An stdObject containing the key and value, false if no such key exists
getSettings()
Fetches all affiliate settings
public
getSettings(int $affiliate_id) : mixed
Parameters
- $affiliate_id : int
-
The affiliate ID
Return values
mixed —An array of objects with key/value pairs of settings, false if no results found
setSetting()
Sets the setting with the given key, overwriting any existing value with that key
public
setSetting(int $affiliate_id, string $key, string $value) : mixed
Parameters
- $affiliate_id : int
-
The affiliate ID
- $key : string
-
The setting identifier
- $value : string
-
The value to set for this setting
setSettings()
Sets a group of settings with key/value pairs
public
setSettings(int $affiliate_id, array<string|int, mixed> $settings) : mixed
Parameters
- $affiliate_id : int
-
The affiliate ID
- $settings : array<string|int, mixed>
-
Settings to set as key/value pairs
Tags
unsetSetting()
Unsets a setting from the order affiliate settings.
public
unsetSetting(int $affiliate_id, string $key) : mixed
Parameters
- $affiliate_id : int
-
The affiliate ID
- $key : string
-
The setting to unset
getRules()
Retrieves rules for adding a setting
private
getRules() : array<string|int, mixed>
Return values
array<string|int, mixed> —The input validation rules