mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 03:14:32 +02:00
Added history tab to admin pages.
This commit is contained in:
parent
0c2af9e968
commit
f9bb2d57e9
3 changed files with 38 additions and 3 deletions
|
@ -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()
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue