Added history tab to admin pages.

This commit is contained in:
Jan Böhmer 2020-03-04 21:09:01 +01:00
parent 0c2af9e968
commit f9bb2d57e9
3 changed files with 38 additions and 3 deletions

View file

@ -21,6 +21,7 @@
namespace App\Services\LogSystem;
use App\Entity\Attachments\AttachmentContainingDBElement;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\Part;
@ -40,10 +41,13 @@ class HistoryHelper
public function getAssociatedElements(AbstractDBElement $element): array
{
$array = [$element];
if ($element instanceof AttachmentContainingDBElement) {
$array = array_merge($array, $element->getAttachments()->toArray());
}
if ($element instanceof Part) {
$array = array_merge(
$array,
$element->getAttachments()->toArray(),
$element->getPartLots()->toArray(),
$element->getOrderdetails()->toArray()
);