UpdateOutcomeDTO
extends AbstractBaseDto
in package
Data Transfer Object for updating 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.
- toApiArray() : array<string|int, mixed>
- Convert the DTO to an array for API requests
- toArray() : array<int, array{name: string, contents: string}>
- Convert DTO to array for API request.
- updateCalculationMethod() : self
- Update calculation method and optional int parameter.
- updateDescription() : self
- Update only the description.
- updateMasteryPoints() : self
- Update only the mastery points.
- updateRatings() : self
- Update only the ratings.
- updateTitle() : self
- Update only the title.
- validateCalculationMethod() : bool
- Validate the calculation method.
- validateRatings() : bool
- Validate the rating scale.
- withFields() : self
- Create an UpdateOutcomeDTO with only specific fields.
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> = []
toApiArray()
Convert the DTO to an array for API requests
public
toApiArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toArray()
Convert DTO to array for API request.
public
toArray() : array<int, array{name: string, contents: string}>
Return values
array<int, array{name: string, contents: string}>updateCalculationMethod()
Update calculation method and optional int parameter.
public
static updateCalculationMethod(string $method[, int|null $calculationInt = null ]) : self
Parameters
- $method : string
- $calculationInt : int|null = null
Return values
selfupdateDescription()
Update only the description.
public
static updateDescription(string $description) : self
Parameters
- $description : string
Return values
selfupdateMasteryPoints()
Update only the mastery points.
public
static updateMasteryPoints(float $masteryPoints) : self
Parameters
- $masteryPoints : float
Return values
selfupdateRatings()
Update only the ratings.
public
static updateRatings(array<int, array{description: string, points: float}> $ratings) : self
Parameters
- $ratings : array<int, array{description: string, points: float}>
Return values
selfupdateTitle()
Update only the title.
public
static updateTitle(string $title) : self
Parameters
- $title : string
Return values
selfvalidateCalculationMethod()
Validate the calculation method.
public
validateCalculationMethod() : bool
Return values
boolvalidateRatings()
Validate the rating scale.
public
validateRatings() : bool
Return values
boolwithFields()
Create an UpdateOutcomeDTO with only specific fields.
public
static withFields(array<string, mixed> $fields) : self
Parameters
- $fields : array<string, mixed>