OrderStaffSettings extends OrderModel
Order Staff Settings
Table of Contents
Methods
| getSetting() | Fetch a single setting by key name |
| getSettings() | Fetches all system settings |
| getStaffWithSetting() | Fetches all active staff in the given company with the given order form setting |
| 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 |
Methods
getSetting()
Fetch a single setting by key name
public
getSetting(int $staff_id, mixed $company_id, string $key) : mixed
Parameters
- $staff_id : int
-
The ID of the staff member to fetch settings for
- $company_id : mixed
-
The ID of the company under which the staff member settings should be fetched
- $key : string
-
The key name of the setting to fetch
Return values
mixed —An stdObject containg the key and value, false if no such key exists
getSettings()
Fetches all system settings
public
getSettings(int $staff_id, mixed $company_id) : mixed
Parameters
- $staff_id : int
-
The ID of the staff member to fetch settings for
- $company_id : mixed
-
The ID of the company under which the staff member settings should be fetched
Return values
mixed —An array of objects with key/value pairs of settings, false if no results found
getStaffWithSetting()
Fetches all active staff in the given company with the given order form setting
public
getStaffWithSetting(mixed $company_id, string $key, string $value) : array<string|int, mixed>
Parameters
- $company_id : mixed
-
The ID of the company under which the staff member settings should be fetched
- $key : string
-
The key name of the setting to fetch
- $value : string
-
The value to filter by for this setting
Return values
array<string|int, mixed> —An array of stdClass objects each representing a staff
setSetting()
Sets the setting with the given key, overwriting any existing value with that key
public
setSetting(int $staff_id, mixed $company_id, string $key, string $value) : mixed
Parameters
- $staff_id : int
-
The ID of the staff member to set settings for
- $company_id : mixed
-
The ID of the company under which the staff member settings should be set
- $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 $staff_id, mixed $company_id, array<string|int, mixed> $settings) : mixed
Parameters
- $staff_id : int
-
The ID of the staff member to set settings for
- $company_id : mixed
-
The ID of the company under which the staff member settings should be set
- $settings : array<string|int, mixed>
-
Settings to set as key/value pairs