mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 20:04:34 +02:00
Fixed tests
This commit is contained in:
parent
c86694ab8f
commit
50069c7611
2 changed files with 15 additions and 1 deletions
|
@ -31,6 +31,9 @@ use App\Entity\Parts\PartLot;
|
|||
use App\Entity\PriceInformations\Orderdetail;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
|
||||
|
||||
/**
|
||||
* @implements EntityMergerInterface<Part>
|
||||
*/
|
||||
#[Autoconfigure(public: true)]
|
||||
class PartMerger implements EntityMergerInterface
|
||||
{
|
||||
|
@ -74,7 +77,7 @@ class PartMerger implements EntityMergerInterface
|
|||
$this->mergeTags($target, $other, 'tags');
|
||||
|
||||
//Merge manufacturing status
|
||||
$this->useCallback(function (?ManufacturingStatus $t, ?ManufacturingStatus $o): ?ManufacturingStatus {
|
||||
$this->useCallback(function (?ManufacturingStatus $t, ?ManufacturingStatus $o): ManufacturingStatus {
|
||||
//Use the other value, if the target value is not set
|
||||
if ($t === ManufacturingStatus::NOT_SET || $t === null) {
|
||||
return $o ?? ManufacturingStatus::NOT_SET;
|
||||
|
@ -91,6 +94,9 @@ class PartMerger implements EntityMergerInterface
|
|||
return $t;
|
||||
}, $target, $other, 'providerReference');
|
||||
|
||||
//Merge the collections
|
||||
$this->mergeCollectionFields($target, $other, $context);
|
||||
|
||||
return $target;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue