9 namespace Fossology\Lib\Report;
23 public function __construct()
27 $this->clearingDao = $container->get(
'dao.clearing');
28 $this->licenseDao = $container->get(
'dao.license');
30 parent::__construct($groupBy =
'text');
33 protected function getStatements($uploadId, $uploadTreeTableName, $groupId =
null)
35 $dbManager = $GLOBALS[
'container']->get(
'db.manager');
36 $licenseMap =
new LicenseMap($dbManager, $groupId, LicenseMap::REPORT,
true);
37 $mainLicIds = $this->clearingDao->getMainLicenseIds($uploadId, $groupId);
39 $allStatements = array();
40 foreach ($mainLicIds as $originLicenseId) {
41 $allLicenseCols = $this->licenseDao->getLicenseById($originLicenseId, $groupId);
42 $allStatements[] = array(
43 'licenseId' => $originLicenseId,
44 'risk' => $allLicenseCols->getRisk(),
45 'content' => $licenseMap->getProjectedSpdxId($originLicenseId),
46 'text' => $allLicenseCols->getText(),
47 'name' => $licenseMap->getProjectedShortname($originLicenseId,
48 $allLicenseCols->getShortName())
51 return $allStatements;
54 public function getCleared($uploadId, $objectAgent, $groupId=
null, $extended=
true, $agentcall=
null, $isUnifiedReport=
false)
56 $uploadTreeTableName = $this->uploadDao->getUploadtreeTableName($uploadId);
57 $statements = $this->
getStatements($uploadId, $uploadTreeTableName, $groupId);
59 for ($i=0; $i<=count($statements); $i++) {
60 unset($statements[$i][
'risk']);
61 unset($statements[$i][
'licenseId']);
64 return array(
"statements" => array_values($statements));
Wrapper class for license map.
getStatements($uploadId, $uploadTreeTableName, $groupId=null)