public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if ($this->orderBy === null) {
         $this->orderBy = KalturaCategoryOrderBy::DEPTH_ASC;
     }
     $categoryFilter = $this->toObject();
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     $categoryFilter->attachToCriteria($c);
     $pager->attachToCriteria($c);
     $dbList = categoryPeer::doSelect($c);
     $totalCount = $c->getRecordsCount();
     $list = KalturaCategoryArray::fromDbArray($dbList, $responseProfile);
     $response = new KalturaCategoryListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }
Beispiel #2
0
 /**
  * List all categories
  * 
  * @action list
  * @return KalturaCategoryListResponse
  */
 function listAction(KalturaCategoryFilter $filter = null)
 {
     if ($filter === null) {
         $filter = new KalturaCategoryFilter();
     }
     if ($filter->orderBy === null) {
         $filter->orderBy = KalturaCategoryOrderBy::DEPTH_ASC;
     }
     $categoryFilter = new categoryFilter();
     $filter->toObject($categoryFilter);
     $c = new Criteria();
     $categoryFilter->attachToCriteria($c);
     $totalCount = categoryPeer::doCount($c);
     $dbList = categoryPeer::doSelect($c);
     $list = KalturaCategoryArray::fromCategoryArray($dbList);
     $response = new KalturaCategoryListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }
 /**
  * List all categories
  * 
  * @action list
  * @param KalturaCategoryFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaCategoryListResponse
  */
 function listAction(KalturaCategoryFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if ($filter === null) {
         $filter = new KalturaCategoryFilter();
     }
     if ($pager == null) {
         $pager = new KalturaFilterPager();
         //before falcon we didn’t have a pager for action category->list,
         //and since we added a pager – and remove the limit for partners categories,
         //for backward compatibility this will be the page size.
         $pager->pageIndex = 1;
         $pager->pageSize = partner::MAX_NUMBER_OF_CATEGORIES;
         KalturaCriteria::setMaxRecords(partner::MAX_NUMBER_OF_CATEGORIES);
         baseObjectFilter::setMaxInValues(partner::MAX_NUMBER_OF_CATEGORIES);
     }
     if ($filter->orderBy === null) {
         $filter->orderBy = KalturaCategoryOrderBy::DEPTH_ASC;
     }
     $categoryFilter = new categoryFilter();
     $filter->toObject($categoryFilter);
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     $categoryFilter->attachToCriteria($c);
     $pager->attachToCriteria($c);
     $dbList = categoryPeer::doSelect($c);
     $totalCount = $c->getRecordsCount();
     $list = KalturaCategoryArray::fromCategoryArray($dbList);
     $response = new KalturaCategoryListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }