diff --git a/src/DataTables/Column/LogEntryTargetColumn.php b/src/DataTables/Column/LogEntryTargetColumn.php index 3bf014f3..d6c69655 100644 --- a/src/DataTables/Column/LogEntryTargetColumn.php +++ b/src/DataTables/Column/LogEntryTargetColumn.php @@ -45,6 +45,7 @@ namespace App\DataTables\Column; use App\Entity\Attachments\Attachment; use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractNamedDBElement; +use App\Entity\Contracts\NamedElementInterface; use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\Parameters\AbstractParameter; use App\Entity\Parts\PartLot; @@ -98,7 +99,7 @@ class LogEntryTargetColumn extends AbstractColumn $tmp = ''; //The element is existing - if ($target instanceof AbstractNamedDBElement) { + if ($target instanceof NamedElementInterface && !empty($target->getName())) { try { $tmp = sprintf( '%s', diff --git a/src/Entity/Parts/PartLot.php b/src/Entity/Parts/PartLot.php index 282e5545..2b8676dd 100644 --- a/src/Entity/Parts/PartLot.php +++ b/src/Entity/Parts/PartLot.php @@ -44,6 +44,7 @@ namespace App\Entity\Parts; use App\Entity\Base\AbstractDBElement; use App\Entity\Base\TimestampTrait; +use App\Entity\Contracts\NamedElementInterface; use App\Entity\Contracts\TimeStampableInterface; use App\Validator\Constraints\Selectable; use App\Validator\Constraints\ValidPartLot; @@ -61,7 +62,7 @@ use Symfony\Component\Validator\Constraints as Assert; * @ORM\HasLifecycleCallbacks() * @ValidPartLot() */ -class PartLot extends AbstractDBElement implements TimeStampableInterface +class PartLot extends AbstractDBElement implements TimeStampableInterface, NamedElementInterface { use TimestampTrait; @@ -326,4 +327,12 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface return $this; } + + /** + * @inheritDoc + */ + public function getName(): string + { + return $this->description; + } } diff --git a/src/Entity/PriceInformations/Orderdetail.php b/src/Entity/PriceInformations/Orderdetail.php index 404b50cc..d938bfa3 100644 --- a/src/Entity/PriceInformations/Orderdetail.php +++ b/src/Entity/PriceInformations/Orderdetail.php @@ -52,6 +52,7 @@ namespace App\Entity\PriceInformations; use App\Entity\Base\AbstractDBElement; use App\Entity\Base\TimestampTrait; +use App\Entity\Contracts\NamedElementInterface; use App\Entity\Contracts\TimeStampableInterface; use App\Entity\Parts\Part; use App\Entity\Parts\Supplier; @@ -67,7 +68,7 @@ use Symfony\Component\Validator\Constraints as Assert; * @ORM\Entity() * @ORM\HasLifecycleCallbacks() */ -class Orderdetail extends AbstractDBElement implements TimeStampableInterface +class Orderdetail extends AbstractDBElement implements TimeStampableInterface, NamedElementInterface { use TimestampTrait; @@ -359,4 +360,12 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface return $this; } + + /** + * @inheritDoc + */ + public function getName(): string + { + return $this->getSupplierPartNr(); + } }