/**
  * List partners by filter with paging support
  * Current implementation will only list the sub partners of the partner initiating the api call (using the current KS).
  * This action is only partially implemented to support listing sub partners of a VAR partner.
  * @action list
  * @param KalturaPartnerFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaPartnerListResponse
  */
 public function listAction(KalturaPartnerFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (is_null($filter)) {
         $filter = new KalturaPartnerFilter();
     }
     if (is_null($pager)) {
         $pager = new KalturaFilterPager();
     }
     $partnerFilter = new partnerFilter();
     $filter->toObject($partnerFilter);
     $c = PartnerPeer::getDefaultCriteria();
     $partnerFilter->attachToCriteria($c);
     $response = new KalturaPartnerListResponse();
     $response->totalCount = PartnerPeer::doCount($c);
     $pager->attachToCriteria($c);
     $dbPartners = PartnerPeer::doSelect($c);
     $partnersArray = KalturaPartnerArray::fromPartnerArray($dbPartners);
     $response->objects = $partnersArray;
     return $response;
 }
 /**
  * batch getExclusiveNotificationJob action allows to get a BatchJob of type NOTIFICATION 
  * 
  * @action getExclusiveNotificationJobs
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param int $maxExecutionTime The maximum time in seconds the job reguarly take. Is used for the locking mechanism when determining an unexpected termination of a batch-process.
  * @param int $numberOfJobs The maximum number of jobs to return. 
  * @param KalturaBatchJobFilter $filter Set of rules to fetch only rartial list of jobs  
  * @return KalturaBatchGetExclusiveNotificationJobsResponse 
  */
 function getExclusiveNotificationJobsAction(KalturaExclusiveLockKey $lockKey, $maxExecutionTime, $numberOfJobs, KalturaBatchJobFilter $filter = null)
 {
     $jobs = $this->getExclusiveJobs($lockKey, $maxExecutionTime, $numberOfJobs, $filter, BatchJobType::NOTIFICATION);
     // Because the notifications need the partner's url and policy of mulriNotifications - we'll send the partner list
     $dbPartners = array();
     foreach ($jobs as $job) {
         if (isset($dbPartners[$job->getPartnerId()])) {
             continue;
         }
         $dbPartners[$job->getPartnerId()] = PartnerPeer::retrieveByPK($job->getPartnerId());
     }
     $response = new KalturaBatchGetExclusiveNotificationJobsResponse();
     $response->notifications = KalturaBatchJobArray::fromBatchJobArray($jobs);
     $response->partners = KalturaPartnerArray::fromPartnerArray($dbPartners);
     return $response;
 }
Ejemplo n.º 3
0
 /**
  * @action list
  * @param KalturaPartnerFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaPartnerListResponse
  */
 public function listAction(KalturaPartnerFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (is_null($filter)) {
         $filter = new KalturaPartnerFilter();
     }
     if (is_null($pager)) {
         $pager = new KalturaFilterPager();
     }
     $partnerFilter = new partnerFilter();
     $filter->toObject($partnerFilter);
     $partnerFilter->set('_gt_id', 0);
     $c = new Criteria();
     $partnerFilter->attachToCriteria($c);
     $totalCount = PartnerPeer::doCount($c);
     $pager->attachToCriteria($c);
     $list = PartnerPeer::doSelect($c);
     $newList = KalturaPartnerArray::fromPartnerArray($list);
     $response = new KalturaPartnerListResponse();
     $response->totalCount = $totalCount;
     $response->objects = $newList;
     return $response;
 }