Documentation

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

$ratings

public array<int, array{description: string, points: float}>|null $ratings = 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
self

toApiArray()

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
bool

validateRatings()

Validate the rating scale.

public validateRatings() : bool
Return values
bool

withCalculationMethod()

Set calculation method with validation.

public withCalculationMethod(string $method[, int|null $calculationInt = null ]) : self
Parameters
$method : string
$calculationInt : int|null = null
Tags
throws
InvalidArgumentException
Return values
self

withRatings()

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}>
Return values
self

        
On this page

Search results