Fixed exception related that Datetimeimmutables were used were doctrine expected mutable ones

this prevented the saving of parts from info providers
This commit is contained in:
Jan Böhmer 2024-06-13 23:41:35 +02:00
parent 6e9b337b49
commit 7ad2fab53d
16 changed files with 39 additions and 39 deletions

View file

@ -182,9 +182,9 @@ class Category extends AbstractPartsContainingDBElement
protected Collection $parameters;
#[Groups(['category:read'])]
protected ?\DateTimeInterface $addedDate = null;
protected ?\DateTime $addedDate = null;
#[Groups(['category:read'])]
protected ?\DateTimeInterface $lastModified = null;
protected ?\DateTime $lastModified = null;
#[Assert\Valid]
#[ORM\Embedded(class: EDACategoryInfo::class)]

View file

@ -133,9 +133,9 @@ class Footprint extends AbstractPartsContainingDBElement
protected Collection $parameters;
#[Groups(['footprint:read'])]
protected ?\DateTimeInterface $addedDate = null;
protected ?\DateTime $addedDate = null;
#[Groups(['footprint:read'])]
protected ?\DateTimeInterface $lastModified = null;
protected ?\DateTime $lastModified = null;
#[Assert\Valid]
#[ORM\Embedded(class: EDAFootprintInfo::class)]

View file

@ -55,7 +55,7 @@ class InfoProviderReference
#[Column(type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => null])]
#[Groups(['provider_reference:read'])]
private ?\DateTimeInterface $last_updated = null;
private ?\DateTime $last_updated = null;
/**
* Constructing is forbidden from outside.
@ -139,7 +139,7 @@ class InfoProviderReference
$ref->provider_key = $provider_key;
$ref->provider_id = $provider_id;
$ref->provider_url = $provider_url;
$ref->last_updated = new \DateTimeImmutable();
$ref->last_updated = new \DateTime();
return $ref;
}
@ -154,7 +154,7 @@ class InfoProviderReference
$ref->provider_key = $dto->provider_key;
$ref->provider_id = $dto->provider_id;
$ref->provider_url = $dto->provider_url;
$ref->last_updated = new \DateTimeImmutable();
$ref->last_updated = new \DateTime();
return $ref;
}
}

View file

@ -155,9 +155,9 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
protected Collection $parameters;
#[Groups(['measurement_unit:read'])]
protected ?\DateTimeInterface $addedDate = null;
protected ?\DateTime $addedDate = null;
#[Groups(['measurement_unit:read'])]
protected ?\DateTimeInterface $lastModified = null;
protected ?\DateTime $lastModified = null;
/**

View file

@ -153,9 +153,9 @@ class Part extends AttachmentContainingDBElement
protected ?Attachment $master_picture_attachment = null;
#[Groups(['part:read'])]
protected ?\DateTimeInterface $addedDate = null;
protected ?\DateTime $addedDate = null;
#[Groups(['part:read'])]
protected ?\DateTimeInterface $lastModified = null;
protected ?\DateTime $lastModified = null;
public function __construct()

View file

@ -105,13 +105,13 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
protected string $comment = '';
/**
* @var \DateTimeInterface|null Set a time until when the lot must be used.
* @var \DateTime|null Set a time until when the lot must be used.
* Set to null, if the lot can be used indefinitely.
*/
#[Groups(['extended', 'full', 'import', 'part_lot:read', 'part_lot:write'])]
#[ORM\Column(name: 'expiration_date', type: Types::DATETIME_MUTABLE, nullable: true)]
#[Year2038BugWorkaround]
protected ?\DateTimeInterface $expiration_date = null;
protected ?\DateTime $expiration_date = null;
/**
* @var StorageLocation|null The storelocation of this lot
@ -246,7 +246,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
*
*
*/
public function setExpirationDate(?\DateTimeInterface $expiration_date): self
public function setExpirationDate(?\DateTime $expiration_date): self
{
$this->expiration_date = $expiration_date;

View file

@ -169,9 +169,9 @@ class StorageLocation extends AbstractPartsContainingDBElement
protected ?Attachment $master_picture_attachment = null;
#[Groups(['location:read'])]
protected ?\DateTimeInterface $addedDate = null;
protected ?\DateTime $addedDate = null;
#[Groups(['location:read'])]
protected ?\DateTimeInterface $lastModified = null;
protected ?\DateTime $lastModified = null;
/********************************************************************************