CreateOutcomeGroupDTO
extends AbstractBaseDto
in package
Data Transfer Object for creating outcome groups.
Table of Contents
Properties
- $description : string|null
- $parentOutcomeGroupId : int|null
- $title : string|null
- $vendorGuid : string|null
- $apiPropertyName : string
- The name of the property in the API
Methods
- __construct() : mixed
- BaseDto constructor.
- asSubgroup() : self
- Create a subgroup with parent.
- 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.
- validate() : bool
- Validate the DTO data.
- withTitle() : self
- Create a group with required title only.
- withTitleAndDescription() : self
- Create a group with title and description.
- withVendorGuid() : self
- Set vendor GUID for external integration.
Properties
$description
public
string|null
$description
= null
$parentOutcomeGroupId
public
int|null
$parentOutcomeGroupId
= 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_group'
Methods
__construct()
BaseDto constructor.
public
__construct([array<string, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string, mixed> = []
asSubgroup()
Create a subgroup with parent.
public
static asSubgroup(string $title, int $parentGroupId) : self
Parameters
- $title : string
- $parentGroupId : int
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()
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}>validate()
Validate the DTO data.
public
validate() : bool
Return values
boolwithTitle()
Create a group with required title only.
public
static withTitle(string $title) : self
Parameters
- $title : string
Return values
selfwithTitleAndDescription()
Create a group with title and description.
public
static withTitleAndDescription(string $title, string $description) : self
Parameters
- $title : string
- $description : string
Return values
selfwithVendorGuid()
Set vendor GUID for external integration.
public
withVendorGuid(string $vendorGuid) : self
Parameters
- $vendorGuid : string