ServiceVariations
in package
Tags
Table of Contents
- $variations : array<string|int, ServiceVariation>
- __construct() : mixed
- getDuration() : int
- getMaxCapacity() : int
- getMinCapacity() : int
- getPrice() : float
- hasVariationForEmployee() : bool
- toArray() : array<string|int, mixed>
- getValue() : mixed
Properties
$variations
public
array<string|int, ServiceVariation>
$variations
Tags
Methods
__construct()
public
__construct(array<string|int, ServiceVariation> $variations) : mixed
Parameters
- $variations : array<string|int, ServiceVariation>
-
[Employee ID => ServiceVariation]
Tags
Return values
mixed —getDuration()
public
getDuration(int $employeeId, int $defaultDuration) : int
Parameters
- $employeeId : int
- $defaultDuration : int
-
Optional. 0 by default.
Tags
Return values
int —getMaxCapacity()
public
getMaxCapacity(int $employeeId[, int $defaultCapacity = 1 ]) : int
Parameters
- $employeeId : int
- $defaultCapacity : int = 1
-
Optional. 1 by default.
Tags
Return values
int —getMinCapacity()
public
getMinCapacity(int $employeeId[, int $defaultCapacity = 1 ]) : int
Parameters
- $employeeId : int
- $defaultCapacity : int = 1
-
Optional. 1 by default.
Tags
Return values
int —getPrice()
public
getPrice(int $employeeId[, float $defaultPrice = 0.0 ]) : float
Parameters
- $employeeId : int
- $defaultPrice : float = 0.0
-
Optional. 0 by default.
Tags
Return values
float —hasVariationForEmployee()
public
hasVariationForEmployee(int $employeeId) : bool
Parameters
- $employeeId : int
Tags
Return values
bool —toArray()
public
toArray([bool $deep = false ]) : array<string|int, mixed>
Parameters
- $deep : bool = false
-
Optional. False by default.
Tags
Return values
array<string|int, mixed> —[Employee ID => ServiceVariations[] or array]
getValue()
protected
getValue(string $field, int $employeeId, mixed $defaultValue) : mixed
Parameters
- $field : string
- $employeeId : int
- $defaultValue : mixed