FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ReportImportDataItem.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2017 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 namespace Fossology\ReportImport;
8 
10 
12 {
14  protected $licenseId;
16  protected $customText = NULL;
18  protected $comment = "";
20  private $licenseCandidate = NULL;
21 
22  function __construct($licenseId)
23  {
24  $this->licenseId = $licenseId;
25  }
26 
27  public function setCustomText($customText)
28  {
29  $this->customText = $customText;
30  return $this;
31  }
32 
39  public function setLicenseCandidate($name, $text, $spdxCompatible)
40  {
41  $spdxCompatible = $spdxCompatible == true;
42  $this->licenseCandidate = new License(
43  $this->licenseId,
44  $this->licenseId,
45  $name,
46  "",
47  $text,
48  "", // TODO: $this->getValue($license,'seeAlso'),
49  "", // TODO
50  $spdxCompatible);
51  return $this;
52  }
53 
57  public function getLicenseId()
58  {
59  return $this->licenseId;
60  }
61 
65  public function isSetCustomText()
66  {
67  return $this->customText !== NULL;
68  }
69 
73  public function getCustomText()
74  {
75  return $this->customText;
76  }
77 
81  public function getComment()
82  {
83  return $this->comment;
84  }
85 
89  public function isSetLicenseCandidate()
90  {
91  return $this->licenseCandidate !== NULL;
92  }
93 
97  public function getLicenseCandidate()
98  {
99  return $this->licenseCandidate;
100  }
101 }
setLicenseCandidate($name, $text, $spdxCompatible)