mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-28 22:08:17 +02:00
Made order and pricedetails timestampable.
Further the migration fixes the typos in attachment table names and filled empty timestamps with the current date.
This commit is contained in:
parent
d79f580b30
commit
1776cd9a77
6 changed files with 115 additions and 28 deletions
|
@ -62,20 +62,25 @@ declare(strict_types=1);
|
|||
namespace App\Entity\PriceInformations;
|
||||
|
||||
use App\Entity\Base\DBElement;
|
||||
use App\Entity\Base\TimestampTrait;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\Supplier;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\ORM\PersistentCollection;
|
||||
use Exception;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Class Orderdetail.
|
||||
*
|
||||
* @ORM\Table("`orderdetails`")
|
||||
* @ORM\Entity()
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
*/
|
||||
class Orderdetail extends DBElement
|
||||
{
|
||||
use TimestampTrait;
|
||||
|
||||
/**
|
||||
* @var Part
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="orderdetails")
|
||||
|
@ -99,25 +104,20 @@ class Orderdetail extends DBElement
|
|||
* @var string
|
||||
* @ORM\Column(type="string")
|
||||
*/
|
||||
protected $supplierpartnr;
|
||||
protected $supplierpartnr = "";
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $obsolete;
|
||||
protected $obsolete = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @ORM\Column(type="string")
|
||||
* @Assert\Url()
|
||||
*/
|
||||
protected $supplier_product_url;
|
||||
|
||||
/**
|
||||
* @var \DateTime The date when this element was created.
|
||||
* @ORM\Column(type="datetimetz", name="datetime_added")
|
||||
*/
|
||||
protected $addedDate;
|
||||
protected $supplier_product_url = "";
|
||||
|
||||
/**
|
||||
* Returns the ID as an string, defined by the element class.
|
||||
|
@ -151,7 +151,7 @@ class Orderdetail extends DBElement
|
|||
*
|
||||
* @return Supplier the supplier of this orderdetails
|
||||
*/
|
||||
public function getSupplier(): Supplier
|
||||
public function getSupplier(): ?Supplier
|
||||
{
|
||||
return $this->supplier;
|
||||
}
|
||||
|
@ -180,17 +180,6 @@ class Orderdetail extends DBElement
|
|||
return (bool) $this->obsolete;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the date/time when the element was created.
|
||||
* Returns null if the element was not yet saved to DB yet.
|
||||
*
|
||||
* @return \DateTime|null The creation time of the part.
|
||||
*/
|
||||
public function getAddedDate(): ?\DateTime
|
||||
{
|
||||
return $this->addedDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the link to the website of the article on the suppliers website.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue