Esempio n. 1
0
 /**
  * @action getEvents
  * @param KalturaLiveReportType $reportType
  * @param KalturaLiveReportInputFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaReportGraphArray
  */
 public function getEventsAction($reportType, KalturaLiveReportInputFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (is_null($filter)) {
         $filter = new KalturaLiveReportInputFilter();
     }
     if (is_null($pager)) {
         $pager = new KalturaFilterPager();
     }
     $client = new WSLiveReportsClient();
     $wsFilter = $filter->getWSObject();
     $wsFilter->partnerId = kCurrentContext::getCurrentPartnerId();
     $wsPager = new WSLiveReportInputPager($pager->pageSize, $pager->pageIndex);
     $wsResult = $client->getEvents($reportType, $wsFilter, $wsPager);
     $resultsArray = array();
     $objects = explode(";", $wsResult->objects);
     foreach ($objects as $object) {
         if (empty($object)) {
             continue;
         }
         $parts = explode(",", $object);
         $additionalValue = "";
         if (count($parts) > 2) {
             $additionalValue = "," . $parts[2];
         }
         $resultsArray[$parts[0]] = $parts[1] . $additionalValue;
     }
     $kResult = KalturaReportGraphArray::fromReportDataArray(array("audience" => $resultsArray));
     return $kResult;
 }
Esempio n. 2
0
 /**
  * report getGraphs action allows to get a graph data for a specific report. 
  * 
  * @action getGraphs
  * @param KalturaReportType $reportType  
  * @param KalturaReportInputFilter $reportInputFilter
  * @param string $dimension
  * @param string $objectIds - one ID or more (separated by ',') of specific objects to query
  * @return KalturaReportGraphArray 
  */
 function getGraphsAction($reportType, KalturaReportInputFilter $reportInputFilter, $dimension = null, $objectIds = null)
 {
     $reportGraphs = KalturaReportGraphArray::fromReportDataArray(myReportsMgr::getGraph($this->getPartnerId(), $reportType, $reportInputFilter->toReportsInputFilter(), $dimension, $objectIds));
     //print_r ( $reportGraphs );
     //		die();
     return $reportGraphs;
 }
 /**
  * report getGraphs action allows to get a graph data for a specific report. 
  * 
  * @action getGraphs
  * @param KalturaReportType $reportType  
  * @param KalturaReportInputFilter $reportInputFilter
  * @param string $dimension
  * @param string $objectIds - one ID or more (separated by ',') of specific objects to query
  * @return KalturaReportGraphArray 
  */
 public function getGraphsAction($reportType, KalturaReportInputFilter $reportInputFilter, $dimension = null, $objectIds = null)
 {
     if ($reportType == KalturaReportType::PARTNER_USAGE || $reportType == KalturaReportType::VAR_USAGE) {
         $objectIds = $this->validateObjectsAreAllowedPartners($objectIds);
     }
     $reportGraphs = KalturaReportGraphArray::fromReportDataArray(myReportsMgr::getGraph($this->getPartnerId(), $reportType, $reportInputFilter->toReportsInputFilter(), $dimension, $objectIds));
     return $reportGraphs;
 }