mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-14 12:24:33 +02:00
Use typed properties
This commit is contained in:
parent
548ec2ea50
commit
51e05a8669
216 changed files with 603 additions and 698 deletions
|
@ -82,24 +82,24 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
* @var string|null the original filename the file had, when the user uploaded it
|
||||
* @ORM\Column(type="string", nullable=true)
|
||||
*/
|
||||
protected $original_filename;
|
||||
protected ?string $original_filename = null;
|
||||
|
||||
/**
|
||||
* @var string The path to the file relative to a placeholder path like %MEDIA%
|
||||
* @ORM\Column(type="string", name="path")
|
||||
*/
|
||||
protected $path = '';
|
||||
protected string $path = '';
|
||||
|
||||
/**
|
||||
* ORM mapping is done in sub classes (like PartAttachment).
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $show_in_table = false;
|
||||
protected bool $show_in_table = false;
|
||||
|
||||
/**
|
||||
* @var AttachmentType
|
||||
|
@ -108,7 +108,7 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
* @Selectable()
|
||||
* @Assert\NotNull(message="validator.attachment.must_not_be_null")
|
||||
*/
|
||||
protected $attachment_type;
|
||||
protected ?AttachmentType $attachment_type = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
|
|
@ -55,7 +55,7 @@ class AttachmentType extends AbstractStructuralDBElement
|
|||
* @ORM\Column(type="text")
|
||||
* @ValidFileFilter
|
||||
*/
|
||||
protected $filetype_filter = '';
|
||||
protected string $filetype_filter = '';
|
||||
/**
|
||||
* @var Collection<int, AttachmentTypeAttachment>
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||
|
|
|
@ -59,5 +59,5 @@ class AttachmentTypeAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\AttachmentType", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class CategoryAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Category", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class CurrencyAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\PriceInformations\Currency", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class DeviceAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Devices\Device", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class FootprintAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Footprint", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class GroupAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\Group", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -42,5 +42,5 @@ class LabelAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\LabelSystem\LabelProfile", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class ManufacturerAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Manufacturer", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -61,5 +61,5 @@ class MeasurementUnitAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\MeasurementUnit", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class PartAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class StorelocationAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Storelocation", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class SupplierAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
|
@ -60,5 +60,5 @@ class UserAttachment extends Attachment
|
|||
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", inversedBy="attachments")
|
||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||
*/
|
||||
protected $element;
|
||||
protected ?AttachmentContainingDBElement $element = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue