Skip to content

Commit

Permalink
Fixed the specific models creation with custom data.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslanbaidan committed Nov 18, 2024
1 parent f17a7c8 commit f06d6a5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Service/AnrService.php
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ private function duplicateAssets(
$assets = $this->coreAssetTable->findByMode(CoreEntity\AssetSuperClass::MODE_GENERIC);
/** @var CoreEntity\Anr $sourceAnr */
if (!$sourceAnr->getModel()->isGeneric()) {
$assets = array_merge($assets, $sourceAnr->getModel()->getAssets());
$assets = array_merge($assets, $sourceAnr->getModel()->getAssets()->toArray());
}
} else {
$assets = $this->assetTable->findByAnr($sourceAnr);
Expand Down Expand Up @@ -823,7 +823,7 @@ private function duplicateThreats(
$threats = $this->coreThreatTable->findByMode(CoreEntity\ThreatSuperClass::MODE_GENERIC);
/** @var CoreEntity\Anr $sourceAnr */
if (!$sourceAnr->getModel()->isGeneric()) {
$threats = array_merge($threats, $sourceAnr->getModel()->getThreats());
$threats = array_merge($threats, $sourceAnr->getModel()->getThreats()->toArray());
}
} else {
$threats = $this->threatTable->findByAnr($sourceAnr);
Expand Down Expand Up @@ -874,7 +874,10 @@ private function duplicateVulnerabilities(
);
/** @var CoreEntity\Anr $sourceAnr */
if (!$sourceAnr->getModel()->isGeneric()) {
$vulnerabilities = array_merge($vulnerabilities, $sourceAnr->getModel()->getVulnerabilities());
$vulnerabilities = array_merge(
$vulnerabilities,
$sourceAnr->getModel()->getVulnerabilities()->toArray()
);
}
} else {
$vulnerabilities = $this->vulnerabilityTable->findByAnr($sourceAnr);
Expand Down

0 comments on commit f06d6a5

Please sign in to comment.