mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-20 10:21:32 +00:00
Add type casting for boolean and float fields in hydrator
Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
This commit is contained in:
parent
b5581e6280
commit
584966d7ad
1 changed files with 5 additions and 5 deletions
|
|
@ -117,8 +117,8 @@ class PartDTOHydrator
|
||||||
mass: $row['mass'] ?? null,
|
mass: $row['mass'] ?? null,
|
||||||
gtin: $row['gtin'] ?? null,
|
gtin: $row['gtin'] ?? null,
|
||||||
tags: $row['tags'] ?? '',
|
tags: $row['tags'] ?? '',
|
||||||
favorite: $row['favorite'] ?? false,
|
favorite: (bool)($row['favorite'] ?? false),
|
||||||
needs_review: $row['needs_review'] ?? false,
|
needs_review: (bool)($row['needs_review'] ?? false),
|
||||||
addedDate: $row['addedDate'] ?? null,
|
addedDate: $row['addedDate'] ?? null,
|
||||||
lastModified: $row['lastModified'] ?? null,
|
lastModified: $row['lastModified'] ?? null,
|
||||||
manufacturing_status: $row['manufacturing_status'] ?? null,
|
manufacturing_status: $row['manufacturing_status'] ?? null,
|
||||||
|
|
@ -139,9 +139,9 @@ class PartDTOHydrator
|
||||||
footprint_attachment_id: $row['footprint_attachment_id'] ?? null,
|
footprint_attachment_id: $row['footprint_attachment_id'] ?? null,
|
||||||
builtProject_id: $row['builtProject_id'] ?? null,
|
builtProject_id: $row['builtProject_id'] ?? null,
|
||||||
builtProject_name: $row['builtProject_name'] ?? null,
|
builtProject_name: $row['builtProject_name'] ?? null,
|
||||||
amountSum: $row['amountSum'] ?? 0.0,
|
amountSum: (float)($row['amountSum'] ?? 0.0),
|
||||||
expiredAmountSum: $row['expiredAmountSum'] ?? 0.0,
|
expiredAmountSum: (float)($row['expiredAmountSum'] ?? 0.0),
|
||||||
hasUnknownAmount: $row['hasUnknownAmount'] ?? false,
|
hasUnknownAmount: (bool)($row['hasUnknownAmount'] ?? false),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Attach grouped data
|
// Attach grouped data
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue