mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-14 14:19:33 +00:00
Use DatetimeImmutable instead of DateTime wherever possible
This commit is contained in:
parent
eebc373734
commit
235d572f8c
39 changed files with 222 additions and 112 deletions
|
|
@ -46,7 +46,7 @@ use App\Entity\Contracts\NamedElementInterface;
|
|||
use App\Entity\Contracts\TimeStampableInterface;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\Supplier;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
|
@ -173,9 +173,9 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N
|
|||
#[ORM\PreUpdate]
|
||||
public function updateTimestamps(): void
|
||||
{
|
||||
$this->lastModified = new DateTime('now');
|
||||
$this->lastModified = new DateTimeImmutable('now');
|
||||
if (!$this->addedDate instanceof \DateTimeInterface) {
|
||||
$this->addedDate = new DateTime('now');
|
||||
$this->addedDate = new DateTimeImmutable('now');
|
||||
}
|
||||
|
||||
if ($this->part instanceof Part) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue