CreateOutcomeDTO
extends AbstractBaseDto
in package
Data Transfer Object for creating outcomes.
Table of Contents
Properties
- $calculationInt : int|null
- $calculationMethod : string|null
- $description : string|null
- $displayName : string|null
- $masteryPoints : float|null
- $ratings : array<int, array{description: string, points: float}>|null
- $title : string|null
- $vendorGuid : string|null
- $apiPropertyName : string
- The name of the property in the API
Methods
- __construct() : mixed
- BaseDto constructor.
- addRating() : self
- Add a single rating.
- toApiArray() : array<string|int, mixed>
- Convert the DTO to an array for API requests
- toArray() : array<int, array{name: string, contents: string}>
- Validate and format the DTO data.
- validateCalculationMethod() : bool
- Validate the calculation method.
- validateRatings() : bool
- Validate the rating scale.
- withCalculationMethod() : self
- Set calculation method with validation.
- withRatings() : self
- Set ratings with builder pattern.
Properties
$calculationInt
public
int|null
$calculationInt
= null
$calculationMethod
public
string|null
$calculationMethod
= null
$description
public
string|null
$description
= null
$displayName
public
string|null
$displayName
= null
$masteryPoints
public
float|null
$masteryPoints
= null
$ratings
public
array<int, array{description: string, points: float}>|null
$ratings
= null
$title
public
string|null
$title
= null
$vendorGuid
public
string|null
$vendorGuid
= null
$apiPropertyName
The name of the property in the API
protected
string
$apiPropertyName
= 'outcome'
Methods
__construct()
BaseDto constructor.
public
__construct([array<string, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string, mixed> = []
addRating()
Add a single rating.
public
addRating(string $description, float $points) : self
Parameters
- $description : string
- $points : float
Return values
selftoApiArray()
Convert the DTO to an array for API requests
public
toApiArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toArray()
Validate and format the DTO data.
public
toArray() : array<int, array{name: string, contents: string}>
Return values
array<int, array{name: string, contents: string}>validateCalculationMethod()
Validate the calculation method.
public
validateCalculationMethod() : bool
Return values
boolvalidateRatings()
Validate the rating scale.
public
validateRatings() : bool
Return values
boolwithCalculationMethod()
Set calculation method with validation.
public
withCalculationMethod(string $method[, int|null $calculationInt = null ]) : self
Parameters
- $method : string
- $calculationInt : int|null = null
Tags
Return values
selfwithRatings()
Set ratings with builder pattern.
public
withRatings(array<int, array{description: string, points: float}> $ratings) : self
Parameters
- $ratings : array<int, array{description: string, points: float}>