29 private $copyrightDao;
33 protected $getOnlyCleared;
34 protected $extrawhere;
36 public function __construct($tableName, $type=null, $getOnlyCleared=
false, $extraWhere=null)
40 $this->copyrightDao = $container->get(
'dao.copyright');
42 $this->getOnlyCleared = $getOnlyCleared;
44 $this->tableName = $tableName;
45 $this->extrawhere = $extraWhere;
46 parent::__construct();
49 protected function getStatements($uploadId, $uploadTreeTableName, $groupId = null)
51 $agentName = $this->tableName;
52 $scanJobProxy =
new ScanJobProxy($GLOBALS[
'container']->
get(
'dao.agent'), $uploadId);
53 $scanJobProxy->createAgentStatus(array($agentName));
54 $selectedScanners = $scanJobProxy->getLatestSuccessfulAgentIds();
55 if (!array_key_exists($agentName, $selectedScanners)) {
58 $latestXpAgentId = $selectedScanners[$agentName];
59 if (!empty($this->extrawhere)) {
60 $this->extrawhere .=
' AND';
62 $this->extrawhere .=
' agent_fk='.$latestXpAgentId;
64 return $this->copyrightDao->getAllEntriesReport($this->tableName, $uploadId, $uploadTreeTableName, $this->type, $this->getOnlyCleared, DecisionTypes::IDENTIFIED, $this->extrawhere, $groupId);