mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
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:
parent
6e9b337b49
commit
7ad2fab53d
16 changed files with 39 additions and 39 deletions
|
@ -185,9 +185,9 @@ abstract class Attachment extends AbstractNamedDBElement
|
||||||
protected ?AttachmentType $attachment_type = null;
|
protected ?AttachmentType $attachment_type = null;
|
||||||
|
|
||||||
#[Groups(['attachment:read'])]
|
#[Groups(['attachment:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['attachment:read'])]
|
#[Groups(['attachment:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|
|
@ -134,9 +134,9 @@ class AttachmentType extends AbstractStructuralDBElement
|
||||||
protected Collection $attachments_with_type;
|
protected Collection $attachments_with_type;
|
||||||
|
|
||||||
#[Groups(['attachment_type:read'])]
|
#[Groups(['attachment_type:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['attachment_type:read'])]
|
#[Groups(['attachment_type:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|
|
@ -41,9 +41,9 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||||
abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
||||||
{
|
{
|
||||||
#[Groups(['company:read'])]
|
#[Groups(['company:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['company:read'])]
|
#[Groups(['company:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The address of the company
|
* @var string The address of the company
|
||||||
|
|
|
@ -34,20 +34,20 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||||
trait TimestampTrait
|
trait TimestampTrait
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var \DateTimeInterface|null the date when this element was modified the last time
|
* @var \DateTime|null the date when this element was modified the last time
|
||||||
*/
|
*/
|
||||||
#[Groups(['extended', 'full'])]
|
#[Groups(['extended', 'full'])]
|
||||||
#[ApiProperty(writable: false)]
|
#[ApiProperty(writable: false)]
|
||||||
#[ORM\Column(name: 'last_modified', type: Types::DATETIME_MUTABLE, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
#[ORM\Column(name: 'last_modified', type: Types::DATETIME_MUTABLE, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTimeInterface|null the date when this element was created
|
* @var \DateTime|null the date when this element was created
|
||||||
*/
|
*/
|
||||||
#[Groups(['extended', 'full'])]
|
#[Groups(['extended', 'full'])]
|
||||||
#[ApiProperty(writable: false)]
|
#[ApiProperty(writable: false)]
|
||||||
#[ORM\Column(name: 'datetime_added', type: Types::DATETIME_MUTABLE, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
#[ORM\Column(name: 'datetime_added', type: Types::DATETIME_MUTABLE, options: ['default' => 'CURRENT_TIMESTAMP'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the last time when the element was modified.
|
* Returns the last time when the element was modified.
|
||||||
|
|
|
@ -55,10 +55,10 @@ abstract class AbstractLogEntry extends AbstractDBElement
|
||||||
#[ORM\Column(type: Types::STRING)]
|
#[ORM\Column(type: Types::STRING)]
|
||||||
protected string $username = '';
|
protected string $username = '';
|
||||||
|
|
||||||
/** @var \DateTimeInterface The datetime the event associated with this log entry has occured
|
/** @var \DateTime The datetime the event associated with this log entry has occured
|
||||||
*/
|
*/
|
||||||
#[ORM\Column(name: 'datetime', type: Types::DATETIME_MUTABLE)]
|
#[ORM\Column(name: 'datetime', type: Types::DATETIME_MUTABLE)]
|
||||||
protected \DateTimeInterface $timestamp;
|
protected \DateTime $timestamp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var LogLevel The priority level of the associated level. 0 is highest, 7 lowest
|
* @var LogLevel The priority level of the associated level. 0 is highest, 7 lowest
|
||||||
|
@ -174,7 +174,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setTimestamp(\DateTimeInterface $timestamp): self
|
public function setTimestamp(\DateTime $timestamp): self
|
||||||
{
|
{
|
||||||
$this->timestamp = $timestamp;
|
$this->timestamp = $timestamp;
|
||||||
|
|
||||||
|
|
|
@ -182,9 +182,9 @@ class Category extends AbstractPartsContainingDBElement
|
||||||
protected Collection $parameters;
|
protected Collection $parameters;
|
||||||
|
|
||||||
#[Groups(['category:read'])]
|
#[Groups(['category:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['category:read'])]
|
#[Groups(['category:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
#[Assert\Valid]
|
#[Assert\Valid]
|
||||||
#[ORM\Embedded(class: EDACategoryInfo::class)]
|
#[ORM\Embedded(class: EDACategoryInfo::class)]
|
||||||
|
|
|
@ -133,9 +133,9 @@ class Footprint extends AbstractPartsContainingDBElement
|
||||||
protected Collection $parameters;
|
protected Collection $parameters;
|
||||||
|
|
||||||
#[Groups(['footprint:read'])]
|
#[Groups(['footprint:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['footprint:read'])]
|
#[Groups(['footprint:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
#[Assert\Valid]
|
#[Assert\Valid]
|
||||||
#[ORM\Embedded(class: EDAFootprintInfo::class)]
|
#[ORM\Embedded(class: EDAFootprintInfo::class)]
|
||||||
|
|
|
@ -55,7 +55,7 @@ class InfoProviderReference
|
||||||
|
|
||||||
#[Column(type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => null])]
|
#[Column(type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => null])]
|
||||||
#[Groups(['provider_reference:read'])]
|
#[Groups(['provider_reference:read'])]
|
||||||
private ?\DateTimeInterface $last_updated = null;
|
private ?\DateTime $last_updated = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructing is forbidden from outside.
|
* Constructing is forbidden from outside.
|
||||||
|
@ -139,7 +139,7 @@ class InfoProviderReference
|
||||||
$ref->provider_key = $provider_key;
|
$ref->provider_key = $provider_key;
|
||||||
$ref->provider_id = $provider_id;
|
$ref->provider_id = $provider_id;
|
||||||
$ref->provider_url = $provider_url;
|
$ref->provider_url = $provider_url;
|
||||||
$ref->last_updated = new \DateTimeImmutable();
|
$ref->last_updated = new \DateTime();
|
||||||
return $ref;
|
return $ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ class InfoProviderReference
|
||||||
$ref->provider_key = $dto->provider_key;
|
$ref->provider_key = $dto->provider_key;
|
||||||
$ref->provider_id = $dto->provider_id;
|
$ref->provider_id = $dto->provider_id;
|
||||||
$ref->provider_url = $dto->provider_url;
|
$ref->provider_url = $dto->provider_url;
|
||||||
$ref->last_updated = new \DateTimeImmutable();
|
$ref->last_updated = new \DateTime();
|
||||||
return $ref;
|
return $ref;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -155,9 +155,9 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
|
||||||
protected Collection $parameters;
|
protected Collection $parameters;
|
||||||
|
|
||||||
#[Groups(['measurement_unit:read'])]
|
#[Groups(['measurement_unit:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['measurement_unit:read'])]
|
#[Groups(['measurement_unit:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -153,9 +153,9 @@ class Part extends AttachmentContainingDBElement
|
||||||
protected ?Attachment $master_picture_attachment = null;
|
protected ?Attachment $master_picture_attachment = null;
|
||||||
|
|
||||||
#[Groups(['part:read'])]
|
#[Groups(['part:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['part:read'])]
|
#[Groups(['part:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|
|
@ -105,13 +105,13 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
|
||||||
protected string $comment = '';
|
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.
|
* Set to null, if the lot can be used indefinitely.
|
||||||
*/
|
*/
|
||||||
#[Groups(['extended', 'full', 'import', 'part_lot:read', 'part_lot:write'])]
|
#[Groups(['extended', 'full', 'import', 'part_lot:read', 'part_lot:write'])]
|
||||||
#[ORM\Column(name: 'expiration_date', type: Types::DATETIME_MUTABLE, nullable: true)]
|
#[ORM\Column(name: 'expiration_date', type: Types::DATETIME_MUTABLE, nullable: true)]
|
||||||
#[Year2038BugWorkaround]
|
#[Year2038BugWorkaround]
|
||||||
protected ?\DateTimeInterface $expiration_date = null;
|
protected ?\DateTime $expiration_date = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StorageLocation|null The storelocation of this lot
|
* @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;
|
$this->expiration_date = $expiration_date;
|
||||||
|
|
||||||
|
|
|
@ -169,9 +169,9 @@ class StorageLocation extends AbstractPartsContainingDBElement
|
||||||
protected ?Attachment $master_picture_attachment = null;
|
protected ?Attachment $master_picture_attachment = null;
|
||||||
|
|
||||||
#[Groups(['location:read'])]
|
#[Groups(['location:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['location:read'])]
|
#[Groups(['location:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
|
|
|
@ -155,9 +155,9 @@ class Currency extends AbstractStructuralDBElement
|
||||||
protected Collection $pricedetails;
|
protected Collection $pricedetails;
|
||||||
|
|
||||||
#[Groups(['currency:read'])]
|
#[Groups(['currency:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['currency:read'])]
|
#[Groups(['currency:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|
|
@ -154,9 +154,9 @@ class Project extends AbstractStructuralDBElement
|
||||||
protected Collection $parameters;
|
protected Collection $parameters;
|
||||||
|
|
||||||
#[Groups(['project:read'])]
|
#[Groups(['project:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
#[Groups(['project:read'])]
|
#[Groups(['project:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
|
|
|
@ -116,10 +116,10 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
||||||
protected ?int $id = null;
|
protected ?int $id = null;
|
||||||
|
|
||||||
#[Groups(['user:read'])]
|
#[Groups(['user:read'])]
|
||||||
protected ?\DateTimeInterface $lastModified = null;
|
protected ?\DateTime $lastModified = null;
|
||||||
|
|
||||||
#[Groups(['user:read'])]
|
#[Groups(['user:read'])]
|
||||||
protected ?\DateTimeInterface $addedDate = null;
|
protected ?\DateTime $addedDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool Determines if the user is disabled (user can not log in)
|
* @var bool Determines if the user is disabled (user can not log in)
|
||||||
|
@ -317,10 +317,10 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
||||||
protected ?PermissionData $permissions = null;
|
protected ?PermissionData $permissions = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTimeInterface|null the time until the password reset token is valid
|
* @var \DateTime|null the time until the password reset token is valid
|
||||||
*/
|
*/
|
||||||
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
||||||
protected ?\DateTimeInterface $pw_reset_expires = null;
|
protected ?\DateTime $pw_reset_expires = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool True if the user was created by a SAML provider (and therefore cannot change its password)
|
* @var bool True if the user was created by a SAML provider (and therefore cannot change its password)
|
||||||
|
@ -535,7 +535,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
||||||
/**
|
/**
|
||||||
* Sets the datetime when the password reset token expires.
|
* Sets the datetime when the password reset token expires.
|
||||||
*/
|
*/
|
||||||
public function setPwResetExpires(\DateTimeInterface $pw_reset_expires): self
|
public function setPwResetExpires(\DateTime $pw_reset_expires): self
|
||||||
{
|
{
|
||||||
$this->pw_reset_expires = $pw_reset_expires;
|
$this->pw_reset_expires = $pw_reset_expires;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class WebauthnKey extends BasePublicKeyCredentialSource implements TimeStampable
|
||||||
protected ?User $user = null;
|
protected ?User $user = null;
|
||||||
|
|
||||||
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)]
|
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||||
protected ?\DateTimeInterface $last_time_used = null;
|
protected ?\DateTimeImmutable $last_time_used = null;
|
||||||
|
|
||||||
public function getName(): string
|
public function getName(): string
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue