diff --git a/src/Command/ConvertBBCodeCommand.php b/src/Command/ConvertBBCodeCommand.php index 07b3d807..5b59a08b 100644 --- a/src/Command/ConvertBBCodeCommand.php +++ b/src/Command/ConvertBBCodeCommand.php @@ -154,7 +154,7 @@ class ConvertBBCodeCommand extends Command foreach ($results as $result) { /** @var AbstractNamedDBElement $result */ $io->writeln( - 'Convert entity: '.$result->getName().' ('.$result->getIDString().')', + 'Convert entity: '.$result->getName().' (' . get_class($result) . ': ' . $result->getID() . ')', OutputInterface::VERBOSITY_VERBOSE ); foreach ($properties as $property) { diff --git a/src/Entity/Attachments/Attachment.php b/src/Entity/Attachments/Attachment.php index ab77d7dd..1094cda9 100644 --- a/src/Entity/Attachments/Attachment.php +++ b/src/Entity/Attachments/Attachment.php @@ -337,16 +337,6 @@ abstract class Attachment extends AbstractNamedDBElement return $this->attachment_type; } - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'A'.sprintf('%09d', $this->getID()); - } /***************************************************************************************************** * Setters diff --git a/src/Entity/Attachments/AttachmentType.php b/src/Entity/Attachments/AttachmentType.php index 6dcabe13..2241f329 100644 --- a/src/Entity/Attachments/AttachmentType.php +++ b/src/Entity/Attachments/AttachmentType.php @@ -118,14 +118,4 @@ class AttachmentType extends AbstractStructuralDBElement return $this; } - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'AT'.sprintf('%09d', $this->getID()); - } } diff --git a/src/Entity/Base/AbstractDBElement.php b/src/Entity/Base/AbstractDBElement.php index 1bc72c56..a186b489 100644 --- a/src/Entity/Base/AbstractDBElement.php +++ b/src/Entity/Base/AbstractDBElement.php @@ -87,14 +87,6 @@ abstract class AbstractDBElement implements \JsonSerializable return $this->id; } - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - abstract public function getIDString(): string; - public function jsonSerialize() { return ['@id' => $this->getID()]; diff --git a/src/Entity/Devices/Device.php b/src/Entity/Devices/Device.php index 0fd16306..3b1931f3 100644 --- a/src/Entity/Devices/Device.php +++ b/src/Entity/Devices/Device.php @@ -168,15 +168,4 @@ class Device extends AbstractPartsContainingDBElement return $this; } - - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'D'.sprintf('%09d', $this->getID()); - } } diff --git a/src/Entity/Devices/DevicePart.php b/src/Entity/Devices/DevicePart.php index 662f2269..8af264d4 100644 --- a/src/Entity/Devices/DevicePart.php +++ b/src/Entity/Devices/DevicePart.php @@ -86,15 +86,4 @@ class DevicePart extends AbstractDBElement * @ORM\JoinColumn(name="id_part", referencedColumnName="id") */ protected $part; - - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'DP'.sprintf('%06d', $this->getID()); - } } diff --git a/src/Entity/LabelSystem/LabelProfile.php b/src/Entity/LabelSystem/LabelProfile.php index 732d0850..1df63357 100644 --- a/src/Entity/LabelSystem/LabelProfile.php +++ b/src/Entity/LabelSystem/LabelProfile.php @@ -120,9 +120,4 @@ class LabelProfile extends AttachmentContainingDBElement return $this; } - - public function getIDString(): string - { - return 'LP'.sprintf('%09d', $this->getID()); - } } diff --git a/src/Entity/LogSystem/AbstractLogEntry.php b/src/Entity/LogSystem/AbstractLogEntry.php index 3f8e9954..67c9c350 100644 --- a/src/Entity/LogSystem/AbstractLogEntry.php +++ b/src/Entity/LogSystem/AbstractLogEntry.php @@ -306,11 +306,6 @@ abstract class AbstractLogEntry extends AbstractDBElement return $this->typeString; } - public function getIDString(): string - { - return 'LOG'.$this->getID(); - } - /** * Returns the class name of the target element associated with this log entry. * Returns null, if this log entry is not associated with an log entry. diff --git a/src/Entity/Parameters/AbstractParameter.php b/src/Entity/Parameters/AbstractParameter.php index 081a2cda..7ee73c92 100644 --- a/src/Entity/Parameters/AbstractParameter.php +++ b/src/Entity/Parameters/AbstractParameter.php @@ -387,11 +387,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement return $this; } - public function getIDString(): string - { - return 'PM'.sprintf('%09d', $this->getID()); - } - /** * Return a string representation and (if possible) with its unit. * diff --git a/src/Entity/Parts/Category.php b/src/Entity/Parts/Category.php index 520736e9..551778df 100644 --- a/src/Entity/Parts/Category.php +++ b/src/Entity/Parts/Category.php @@ -116,16 +116,6 @@ class Category extends AbstractPartsContainingDBElement */ protected $parameters; - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'C'.sprintf('%09d', $this->getID()); - } public function getPartnameHint(): string { diff --git a/src/Entity/Parts/Footprint.php b/src/Entity/Parts/Footprint.php index b5f3fa42..a648afce 100644 --- a/src/Entity/Parts/Footprint.php +++ b/src/Entity/Parts/Footprint.php @@ -103,16 +103,6 @@ class Footprint extends AbstractPartsContainingDBElement */ protected $parameters; - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'F'.sprintf('%06d', $this->getID()); - } /**************************************** * Getters diff --git a/src/Entity/Parts/Manufacturer.php b/src/Entity/Parts/Manufacturer.php index 2b0779f4..ea8434c2 100644 --- a/src/Entity/Parts/Manufacturer.php +++ b/src/Entity/Parts/Manufacturer.php @@ -95,15 +95,4 @@ class Manufacturer extends AbstractCompany * @Assert\Valid() */ protected $parameters; - - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'M'.sprintf('%06d', $this->getID()); - } } diff --git a/src/Entity/Parts/MeasurementUnit.php b/src/Entity/Parts/MeasurementUnit.php index 406b113a..fc8f770a 100644 --- a/src/Entity/Parts/MeasurementUnit.php +++ b/src/Entity/Parts/MeasurementUnit.php @@ -113,16 +113,6 @@ class MeasurementUnit extends AbstractPartsContainingDBElement */ protected $parameters; - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'MU'.$this->getID(); - } /** * @return string diff --git a/src/Entity/Parts/Part.php b/src/Entity/Parts/Part.php index 7501ff27..a067ff1a 100644 --- a/src/Entity/Parts/Part.php +++ b/src/Entity/Parts/Part.php @@ -176,16 +176,6 @@ class Part extends AttachmentContainingDBElement parent::__clone(); } - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'P'.sprintf('%06d', $this->getID()); - } /** * Get all devices which uses this part. diff --git a/src/Entity/Parts/PartLot.php b/src/Entity/Parts/PartLot.php index b2d4ea35..67234d73 100644 --- a/src/Entity/Parts/PartLot.php +++ b/src/Entity/Parts/PartLot.php @@ -128,16 +128,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named parent::__clone(); } - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'PL'.$this->getID(); - } /** * Check if the current part lot is expired. diff --git a/src/Entity/Parts/Storelocation.php b/src/Entity/Parts/Storelocation.php index c47a14ff..c71a4140 100644 --- a/src/Entity/Parts/Storelocation.php +++ b/src/Entity/Parts/Storelocation.php @@ -224,15 +224,4 @@ class Storelocation extends AbstractPartsContainingDBElement return $this; } - - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'L'.sprintf('%06d', $this->getID()); - } } diff --git a/src/Entity/Parts/Supplier.php b/src/Entity/Parts/Supplier.php index e9597008..2a9a2a22 100644 --- a/src/Entity/Parts/Supplier.php +++ b/src/Entity/Parts/Supplier.php @@ -172,15 +172,4 @@ class Supplier extends AbstractCompany return $this; } - - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'L'.sprintf('%06d', $this->getID()); - } } diff --git a/src/Entity/PriceInformations/Currency.php b/src/Entity/PriceInformations/Currency.php index 1441cb47..10025e71 100644 --- a/src/Entity/PriceInformations/Currency.php +++ b/src/Entity/PriceInformations/Currency.php @@ -162,15 +162,4 @@ class Currency extends AbstractStructuralDBElement return $this; } - - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'C'.$this->getID(); - } } diff --git a/src/Entity/PriceInformations/Orderdetail.php b/src/Entity/PriceInformations/Orderdetail.php index 0524316b..47931275 100644 --- a/src/Entity/PriceInformations/Orderdetail.php +++ b/src/Entity/PriceInformations/Orderdetail.php @@ -134,17 +134,6 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N parent::__clone(); } - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'O'.sprintf('%06d', $this->getID()); - } - /******************************************************************************** * * Getters diff --git a/src/Entity/PriceInformations/Pricedetail.php b/src/Entity/PriceInformations/Pricedetail.php index 0a5b87d8..94342119 100644 --- a/src/Entity/PriceInformations/Pricedetail.php +++ b/src/Entity/PriceInformations/Pricedetail.php @@ -330,15 +330,4 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface return $this; } - - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'PD'.sprintf('%06d', $this->getID()); - } } diff --git a/src/Entity/UserSystem/Group.php b/src/Entity/UserSystem/Group.php index bb62d16f..008c28d8 100644 --- a/src/Entity/UserSystem/Group.php +++ b/src/Entity/UserSystem/Group.php @@ -132,17 +132,6 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa return $this; } - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'G'.sprintf('%06d', $this->getID()); - } - public function getPermissions(): PermissionsEmbed { return $this->permissions; diff --git a/src/Entity/UserSystem/User.php b/src/Entity/UserSystem/User.php index ccf57f3d..c9dfa271 100644 --- a/src/Entity/UserSystem/User.php +++ b/src/Entity/UserSystem/User.php @@ -410,16 +410,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe return $this; } - /** - * Returns the ID as an string, defined by the element class. - * This should have a form like P000014, for a part with ID 14. - * - * @return string The ID as a string; - */ - public function getIDString(): string - { - return 'U'.sprintf('%06d', $this->getID()); - } public function getPermissions(): PermissionsEmbed { diff --git a/templates/Parts/info/_extended_infos.html.twig b/templates/Parts/info/_extended_infos.html.twig index 5f4889f0..fdf8bdf7 100644 --- a/templates/Parts/info/_extended_infos.html.twig +++ b/templates/Parts/info/_extended_infos.html.twig @@ -34,7 +34,7 @@