Example #1
0
 /**
  * @return array
  */
 public function getStatistics($usagePeriod = null)
 {
     $overallCount = OnlineShop_Framework_VoucherService_Token_List::getCountBySeriesId($this->seriesId);
     $usageCount = OnlineShop_Framework_VoucherService_Token_List::getCountByUsages(1, $this->seriesId);
     $reservedTokenCount = OnlineShop_Framework_VoucherService_Token_List::getCountByReservation($this->seriesId);
     $usage = OnlineShop_Framework_VoucherService_Statistic::getBySeriesId($this->seriesId, $usagePeriod);
     if (is_array($usage)) {
         $this->prepareUsageStatisticData($usage, $usagePeriod);
     }
     return ['overallCount' => $overallCount, 'usageCount' => $usageCount, 'freeCount' => $overallCount - $usageCount - $reservedTokenCount, 'reservedCount' => $reservedTokenCount, 'usage' => $usage];
 }