FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ClearingEventProcessor.php
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2014 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
9 
12 
18 {
19 
25  public function getClearingLicenseRefs($events)
26  {
27  $result = array();
28 
29  foreach ($events as $event) {
30  $clearingLicense = $event->getClearingLicense();
31  $licenseId = $clearingLicense->getLicenseId();
32 
33  $result[$licenseId] = $clearingLicense->getLicenseRef();
34  }
35 
36  return $result;
37  }
38 
44  public function filterEffectiveEvents($events)
45  {
46  $reducedEvents = array();
47  foreach ($events as $event) {
48  $licenseId = $event->getLicenseId();
49  $reducedEvents[$licenseId] = $event;
50  }
51  return $reducedEvents;
52  }
53 }
filterEffectiveEvents($events)
Filter events based on license id.
getClearingLicenseRefs($events)
Get license refs from clearing events.
Contains business rules for FOSSology.