diff --git a/src/Entity/Attachments/Attachment.php b/src/Entity/Attachments/Attachment.php index 78789001..61f370e4 100644 --- a/src/Entity/Attachments/Attachment.php +++ b/src/Entity/Attachments/Attachment.php @@ -156,6 +156,12 @@ abstract class Attachment extends AbstractNamedDBElement #[Groups(['attachment:read', 'attachment_write'])] protected ?AttachmentType $attachment_type = null; + #[Groups(['attachment:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['attachment:read'])] + protected ?\DateTimeInterface $lastModified = null; + + public function __construct() { //parent::__construct(); diff --git a/src/Entity/Attachments/AttachmentType.php b/src/Entity/Attachments/AttachmentType.php index 3afe0192..d4cc7b25 100644 --- a/src/Entity/Attachments/AttachmentType.php +++ b/src/Entity/Attachments/AttachmentType.php @@ -76,7 +76,7 @@ use Symfony\Component\Validator\Constraints as Assert; uriVariables: [ 'id' => new Link(fromProperty: 'children', fromClass: AttachmentType::class) ], - normalizationContext: ['groups' => ['footprint:read', 'api:basic:read'], 'openapi_definition_name' => 'Read'] + normalizationContext: ['groups' => ['attachment_type:read', 'api:basic:read'], 'openapi_definition_name' => 'Read'] )] #[ApiFilter(PropertyFilter::class)] #[ApiFilter(LikeFilter::class, properties: ["name", "comment"])] @@ -96,7 +96,7 @@ class AttachmentType extends AbstractStructuralDBElement /** * @var string A comma separated list of file types, which are allowed for attachment files. - * Must be in the format of accept attribute + * Must be in the format of
accept attribute * (See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers). */ #[ORM\Column(type: Types::TEXT)] @@ -132,6 +132,12 @@ class AttachmentType extends AbstractStructuralDBElement #[ORM\OneToMany(targetEntity: Attachment::class, mappedBy: 'attachment_type')] protected Collection $attachments_with_type; + #[Groups(['attachment_type:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['attachment_type:read'])] + protected ?\DateTimeInterface $lastModified = null; + + public function __construct() { $this->children = new ArrayCollection(); diff --git a/src/Entity/Parts/Category.php b/src/Entity/Parts/Category.php index 3c15b86c..b1dc8c97 100644 --- a/src/Entity/Parts/Category.php +++ b/src/Entity/Parts/Category.php @@ -177,6 +177,12 @@ class Category extends AbstractPartsContainingDBElement #[ORM\OrderBy(['group' => 'ASC', 'name' => 'ASC'])] protected Collection $parameters; + #[Groups(['category:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['category:read'])] + protected ?\DateTimeInterface $lastModified = null; + + public function getPartnameHint(): string { return $this->partname_hint; diff --git a/src/Entity/Parts/Footprint.php b/src/Entity/Parts/Footprint.php index f65f5031..2cdf9fba 100644 --- a/src/Entity/Parts/Footprint.php +++ b/src/Entity/Parts/Footprint.php @@ -129,6 +129,12 @@ class Footprint extends AbstractPartsContainingDBElement #[Groups(['footprint:read', 'footprint:write'])] protected Collection $parameters; + #[Groups(['footprint:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['footprint:read'])] + protected ?\DateTimeInterface $lastModified = null; + + /**************************************** * Getters ****************************************/ diff --git a/src/Entity/Parts/MeasurementUnit.php b/src/Entity/Parts/MeasurementUnit.php index 4ee4176b..f9f45ca5 100644 --- a/src/Entity/Parts/MeasurementUnit.php +++ b/src/Entity/Parts/MeasurementUnit.php @@ -150,6 +150,12 @@ class MeasurementUnit extends AbstractPartsContainingDBElement #[Groups(['measurement_unit:read', 'measurement_unit:write'])] protected Collection $parameters; + #[Groups(['measurement_unit:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['measurement_unit:read'])] + protected ?\DateTimeInterface $lastModified = null; + + /** * @return string */ diff --git a/src/Entity/Parts/Part.php b/src/Entity/Parts/Part.php index d53ac8f6..fa01d212 100644 --- a/src/Entity/Parts/Part.php +++ b/src/Entity/Parts/Part.php @@ -150,6 +150,12 @@ class Part extends AttachmentContainingDBElement #[Groups(['part:read', 'part:write'])] protected ?Attachment $master_picture_attachment = null; + #[Groups(['part:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['part:read'])] + protected ?\DateTimeInterface $lastModified = null; + + public function __construct() { $this->attachments = new ArrayCollection(); diff --git a/src/Entity/Parts/StorageLocation.php b/src/Entity/Parts/StorageLocation.php index 338e77d9..3a7847d9 100644 --- a/src/Entity/Parts/StorageLocation.php +++ b/src/Entity/Parts/StorageLocation.php @@ -164,6 +164,12 @@ class StorageLocation extends AbstractPartsContainingDBElement #[Groups(['location:read', 'location:write'])] protected ?Attachment $master_picture_attachment = null; + #[Groups(['location:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['location:read'])] + protected ?\DateTimeInterface $lastModified = null; + + /******************************************************************************** * * Getters diff --git a/src/Entity/PriceInformations/Currency.php b/src/Entity/PriceInformations/Currency.php index 0713c8d7..a108feeb 100644 --- a/src/Entity/PriceInformations/Currency.php +++ b/src/Entity/PriceInformations/Currency.php @@ -36,8 +36,6 @@ use ApiPlatform\Metadata\Post; use ApiPlatform\Serializer\Filter\PropertyFilter; use App\ApiPlatform\Filter\LikeFilter; use App\Entity\Attachments\Attachment; -use App\Entity\Attachments\AttachmentTypeAttachment; -use App\Entity\Parts\Footprint; use App\Repository\CurrencyRepository; use Doctrine\DBAL\Types\Types; use App\Entity\Attachments\CurrencyAttachment; @@ -152,6 +150,12 @@ class Currency extends AbstractStructuralDBElement #[ORM\OneToMany(targetEntity: Pricedetail::class, mappedBy: 'currency')] protected Collection $pricedetails; + #[Groups(['currency:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['currency:read'])] + protected ?\DateTimeInterface $lastModified = null; + + public function __construct() { $this->children = new ArrayCollection(); diff --git a/src/Entity/ProjectSystem/Project.php b/src/Entity/ProjectSystem/Project.php index 68cbc0b9..81b1fc09 100644 --- a/src/Entity/ProjectSystem/Project.php +++ b/src/Entity/ProjectSystem/Project.php @@ -153,6 +153,12 @@ class Project extends AbstractStructuralDBElement #[Groups(['project:read', 'project:write'])] protected Collection $parameters; + #[Groups(['project:read'])] + protected ?\DateTimeInterface $addedDate = null; + #[Groups(['project:read'])] + protected ?\DateTimeInterface $lastModified = null; + + /******************************************************************************** * * Getters