mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-10 21:19:30 +00:00
Added some basic DB fields for the new project system
This commit is contained in:
parent
8ae4e9fe05
commit
0c7ec9f0c7
36 changed files with 281 additions and 130 deletions
|
|
@ -44,7 +44,7 @@ use LogicException;
|
|||
* @ORM\DiscriminatorColumn(name="class_name", type="string")
|
||||
* @ORM\DiscriminatorMap({
|
||||
* "PartDB\Part" = "PartAttachment", "Part" = "PartAttachment",
|
||||
* "PartDB\Device" = "DeviceAttachment", "Device" = "DeviceAttachment",
|
||||
* "PartDB\Device" = "ProjectAttachment", "Device" = "ProjectAttachment",
|
||||
* "AttachmentType" = "AttachmentTypeAttachment", "Category" = "CategoryAttachment",
|
||||
* "Footprint" = "FootprintAttachment", "Manufacturer" = "ManufacturerAttachment",
|
||||
* "Currency" = "CurrencyAttachment", "Group" = "GroupAttachment",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Entity\Attachments;
|
||||
|
||||
use App\Entity\Devices\Device;
|
||||
use App\Entity\ProjectSystem\Project;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
|
|
@ -32,12 +32,12 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|||
* @ORM\Entity()
|
||||
* @UniqueEntity({"name", "attachment_type", "element"})
|
||||
*/
|
||||
class DeviceAttachment extends Attachment
|
||||
class ProjectAttachment extends Attachment
|
||||
{
|
||||
public const ALLOWED_ELEMENT_CLASS = Device::class;
|
||||
public const ALLOWED_ELEMENT_CLASS = Project::class;
|
||||
/**
|
||||
* @var Device the element this attachment is associated with
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Devices\Device", inversedBy="attachments")
|
||||
* @var Project the element this attachment is associated with
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\ProjectSystem\Project", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
Loading…
Add table
Add a link
Reference in a new issue