Exemplo n.º 1
0
 /**
  * List base entries by filter with paging support.
  *
  * @action list
  * @param KalturaBaseEntryFilter $filter Entry filter
  * @param KalturaFilterPager $pager Pager
  * @return KalturaBaseEntryListResponse Wrapper for array of base entries and total count
  */
 function listAction(KalturaBaseEntryFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (!$filter) {
         $filter = new KalturaBaseEntryFilter();
     }
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     // NOTE: The following is a hack in order to make sure all responses are of type KalturaBaseEntryListResponse.
     //       The reason is that baseentry::list() is not being extended by derived classes.
     $result = $filter->getListResponse($pager, $this->getResponseProfile());
     $response = new KalturaBaseEntryListResponse();
     $response->objects = $result->objects;
     $response->totalCount = $result->totalCount;
     return $response;
 }
Exemplo n.º 2
0
 /**
  * List base entries by filter with paging support.
  *
  * @action list
  * @param KalturaBaseEntryFilter $filter Entry filter
  * @param KalturaFilterPager $pager Pager
  * @return KalturaBaseEntryListResponse Wrapper for array of base entries and total count
  */
 function listAction(KalturaBaseEntryFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (!$filter) {
         $filter = new KalturaBaseEntryFilter();
     }
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     $result = $filter->getListResponse($pager, $this->getResponseProfile());
     if ($result->totalCount == 1 && count($result->objects) == 1 && $result->objects[0]->status != KalturaEntryStatus::READY) {
         // the purpose of this is to solve a case in which a player attempts to play a non-ready entry,
         // and the request becomes cached for a long time, preventing playback even after the entry
         // becomes ready
         kApiCache::setExpiry(60);
     }
     // NOTE: The following is a hack in order to make sure all responses are of type KalturaBaseEntryListResponse.
     //       The reason is that baseentry::list() is not being extended by derived classes.
     $response = new KalturaBaseEntryListResponse();
     $response->objects = $result->objects;
     $response->totalCount = $result->totalCount;
     return $response;
 }