mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
#591 - sites [wip]
This commit is contained in:
26
app/DTOs/DynamicFieldsCollectionDTO.php
Normal file
26
app/DTOs/DynamicFieldsCollectionDTO.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\DTOs;
|
||||
|
||||
readonly class DynamicFieldsCollectionDTO
|
||||
{
|
||||
/**
|
||||
* @param array<int, DynamicFieldDTO> $fields
|
||||
*/
|
||||
public function __construct(
|
||||
private array $fields = [],
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array<int, mixed>
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
$fields = [];
|
||||
foreach ($this->fields as $field) {
|
||||
$fields[] = $field->toArray();
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user