9 namespace Fossology\Lib\Report;
18 private $copyrightDao;
22 protected $getOnlyCleared;
23 protected $extrawhere;
25 public function __construct($tableName, $type=
null, $getOnlyCleared=
false, $extraWhere=
null)
29 $this->copyrightDao = $container->get(
'dao.copyright');
31 $this->getOnlyCleared = $getOnlyCleared;
33 $this->tableName = $tableName;
34 $this->extrawhere = $extraWhere;
35 parent::__construct();
38 protected function getStatements($uploadId, $uploadTreeTableName, $groupId =
null)
40 $agentName = $this->tableName;
41 $scanJobProxy =
new ScanJobProxy($GLOBALS[
'container']->
get(
'dao.agent'), $uploadId);
42 if ($agentName ==
"copyright") {
43 $scanJobProxy->createAgentStatus(array($agentName,
'reso'));
45 $scanJobProxy->createAgentStatus(array($agentName));
47 $selectedScanners = $scanJobProxy->getLatestSuccessfulAgentIds();
48 if (!array_key_exists($agentName, $selectedScanners)) {
51 $latestXpAgentId[] = $selectedScanners[$agentName];
52 if (array_key_exists(
'reso', $selectedScanners)) {
53 $latestXpAgentId[] = $selectedScanners[
'reso'];
55 $ids = implode(
',', $latestXpAgentId);
56 if (!empty($this->extrawhere)) {
57 $this->extrawhere .=
' AND';
59 $this->extrawhere .=
' agent_fk IN ('.$ids.
')';
61 $result = $this->copyrightDao->getAllEntriesReport($this->tableName, $uploadId, $uploadTreeTableName, $this->type, $this->getOnlyCleared, DecisionTypes::IDENTIFIED, $this->extrawhere, $groupId);
62 $this->extrawhere =
null;
getStatements($uploadId, $uploadTreeTableName, $groupId=null)