mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-09 20:49:30 +00:00
Encapsulate the fieldmapping data in the importjob further
This commit is contained in:
parent
eda6deff47
commit
16126c4000
3 changed files with 39 additions and 17 deletions
|
|
@ -47,7 +47,7 @@ readonly class FieldMappingDTO
|
|||
* Create a FieldMappingDTO from legacy array format.
|
||||
* @param array{field: string, providers: string[], priority?: int} $data
|
||||
*/
|
||||
public static function fromArray(array $data): self
|
||||
public static function fromSerializableArray(array $data): self
|
||||
{
|
||||
return new self(
|
||||
field: $data['field'],
|
||||
|
|
@ -60,7 +60,7 @@ readonly class FieldMappingDTO
|
|||
* Convert this DTO to the legacy array format for backwards compatibility.
|
||||
* @return array{field: string, providers: string[], priority: int}
|
||||
*/
|
||||
public function toArray(): array
|
||||
public function toSerializableArray(): array
|
||||
{
|
||||
return [
|
||||
'field' => $this->field,
|
||||
|
|
@ -89,4 +89,4 @@ readonly class FieldMappingDTO
|
|||
|
||||
return substr($this->field, 0, -4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue