ReassignPricingServices extends ReassignPricingModel
ReassignPricingPackages model
Table of Contents
Methods
| edit() | Updates a service to reassign its pricing information |
| validateModuleCompany() | Validates that the given module row belongs to the given company |
| validateModuleRow() | Validates that the given module row belongs to the given company |
| validatePackageGroupCompany() | Validates that the given package group belongs to the given company |
| validatePricingCompany() | Validates that the given pricing belongs to the given company |
| getPackageModuleRow() | Retrieves the module row associated with the given package pricing |
| getServiceCompany() | Retrieves the company ID of the client the service belongs to |
| getRules() | Retrieves a set of rules to validate updating a service's pricing |
Methods
edit()
Updates a service to reassign its pricing information
public
edit(int $service_id, array<string|int, mixed> $vars) : mixed
Parameters
- $service_id : int
-
The ID of the service to update
- $vars : array<string|int, mixed>
-
A key/value array of service fields to update, including:
- pricing_id The ID of the package's pricing to update to
- package_group_id The ID of the package group to update to
validateModuleCompany()
Validates that the given module row belongs to the given company
public
validateModuleCompany(int $module_row_id, int $company_id) : bool
Parameters
- $module_row_id : int
-
The ID of the module row to check
- $company_id : int
-
The ID of the company
Return values
bool —True if the module row belongs to the given company, or false otherwise
validateModuleRow()
Validates that the given module row belongs to the given company
public
validateModuleRow(int $module_row_id) : bool
Parameters
- $module_row_id : int
-
The ID of the module row to check
Return values
bool —True if the module row belongs to the given company, or false otherwise
validatePackageGroupCompany()
Validates that the given package group belongs to the given company
public
validatePackageGroupCompany(int $package_group_id, int $company_id) : bool
Parameters
- $package_group_id : int
-
The ID of the package group to check
- $company_id : int
-
The ID of the company
Return values
bool —True if the package group belongs to the given company, or false otherwise
validatePricingCompany()
Validates that the given pricing belongs to the given company
public
validatePricingCompany(int $pricing_id, int $company_id) : bool
Parameters
- $pricing_id : int
-
The ID of the package pricing to check
- $company_id : int
-
The ID of the company
Return values
bool —True if the pricing belongs to the given company, or false otherwise
getPackageModuleRow()
Retrieves the module row associated with the given package pricing
protected
getPackageModuleRow(int $pricing_id) : mixed
Parameters
- $pricing_id : int
-
The package pricing ID
Return values
mixed —The module row ID if it exists, or null otherwise
getServiceCompany()
Retrieves the company ID of the client the service belongs to
protected
getServiceCompany(int $service_id) : mixed
Parameters
- $service_id : int
-
The ID of the service
Return values
mixed —The company ID, or null if unknown
getRules()
Retrieves a set of rules to validate updating a service's pricing
private
getRules(array<string|int, mixed> $vars) : array<string|int, mixed>
Parameters
- $vars : array<string|int, mixed>
-
An array of input
Return values
array<string|int, mixed> —An array of Input validation rules