Exemplo n.º 1
0
 /**
  * List application authentication tokens by filter and pager
  * 
  * @action list
  * @param KalturaFilterPager $filter
  * @param KalturaAppTokenFilter $pager
  * @return KalturaAppTokenListResponse
  */
 function listAction(KalturaAppTokenFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (!$filter) {
         $filter = new KalturaAppTokenFilter();
     }
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     $c = new Criteria();
     $appTokenFilter = $filter->toObject();
     $appTokenFilter->attachToCriteria($c);
     $pager->attachToCriteria($c);
     $list = AppTokenPeer::doSelect($c);
     $totalCount = null;
     $resultCount = count($list);
     if ($resultCount && $resultCount < $pager->pageSize) {
         $totalCount = ($pager->pageIndex - 1) * $pager->pageSize + $resultCount;
     } else {
         KalturaFilterPager::detachFromCriteria($c);
         $totalCount = AppTokenPeer::doCount($c);
     }
     $response = new KalturaAppTokenListResponse();
     $response->totalCount = $totalCount;
     $response->objects = KalturaAppTokenArray::fromDbArray($list, $this->getResponseProfile());
     return $response;
 }