/**
  * Search caption asset items by filter, pager and free text
  * 
  * @action search
  * @param KalturaBaseEntryFilter $entryFilter
  * @param KalturaCaptionAssetItemFilter $captionAssetItemFilter
  * @param KalturaFilterPager $captionAssetItemPager
  * @return KalturaCaptionAssetItemListResponse
  */
 function searchAction(KalturaBaseEntryFilter $entryFilter = null, KalturaCaptionAssetItemFilter $captionAssetItemFilter = null, KalturaFilterPager $captionAssetItemPager = null)
 {
     if (!$captionAssetItemPager) {
         $captionAssetItemPager = new KalturaFilterPager();
     }
     if (!$captionAssetItemFilter) {
         $captionAssetItemFilter = new KalturaCaptionAssetItemFilter();
     }
     $captionAssetItemCoreFilter = new CaptionAssetItemFilter();
     $captionAssetItemFilter->toObject($captionAssetItemCoreFilter);
     if ($entryFilter) {
         $entryCoreFilter = new entryFilter();
         $entryFilter->toObject($entryCoreFilter);
         $this->addEntryAdvancedSearchFilter($captionAssetItemFilter, $entryCoreFilter);
         $entryCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
         $entryCoreFilter->attachToCriteria($entryCriteria);
         $entryCriteria->applyFilters();
         $entryIds = $entryCriteria->getFetchedIds();
         if (!$entryIds || !count($entryIds)) {
             $entryIds = array('NOT_EXIST');
         }
         $captionAssetItemCoreFilter->setEntryIdIn($entryIds);
     }
     $captionAssetItemCriteria = KalturaCriteria::create(CaptionAssetItemPeer::OM_CLASS);
     $captionAssetItemCoreFilter->attachToCriteria($captionAssetItemCriteria);
     $captionAssetItemPager->attachToCriteria($captionAssetItemCriteria);
     $dbList = CaptionAssetItemPeer::doSelect($captionAssetItemCriteria);
     $list = KalturaCaptionAssetItemArray::fromDbArray($dbList);
     $response = new KalturaCaptionAssetItemListResponse();
     $response->objects = $list;
     $response->totalCount = $captionAssetItemCriteria->getRecordsCount();
     return $response;
 }
 /**
  * Search caption asset items by filter, pager and free text
  *
  * @action search
  * @param KalturaBaseEntryFilter $entryFilter
  * @param KalturaCaptionAssetItemFilter $captionAssetItemFilter
  * @param KalturaFilterPager $captionAssetItemPager
  * @return KalturaCaptionAssetItemListResponse
  */
 function searchAction(KalturaBaseEntryFilter $entryFilter = null, KalturaCaptionAssetItemFilter $captionAssetItemFilter = null, KalturaFilterPager $captionAssetItemPager = null)
 {
     if (!$captionAssetItemPager) {
         $captionAssetItemPager = new KalturaFilterPager();
     }
     if (!$captionAssetItemFilter) {
         $captionAssetItemFilter = new KalturaCaptionAssetItemFilter();
     }
     $captionAssetItemFilter->validatePropertyNotNull(array("contentLike", "contentMultiLikeOr", "contentMultiLikeAnd"));
     $captionAssetItemCoreFilter = new CaptionAssetItemFilter();
     $captionAssetItemFilter->toObject($captionAssetItemCoreFilter);
     if ($entryFilter || kEntitlementUtils::getEntitlementEnforcement()) {
         $entryCoreFilter = new entryFilter();
         if ($entryFilter) {
             $entryFilter->toObject($entryCoreFilter);
         }
         $entryCoreFilter->setPartnerSearchScope($this->getPartnerId());
         $this->addEntryAdvancedSearchFilter($captionAssetItemFilter, $entryCoreFilter);
         $entryCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
         $entryCoreFilter->attachToCriteria($entryCriteria);
         $entryCriteria->applyFilters();
         $entryIds = $entryCriteria->getFetchedIds();
         if (!$entryIds || !count($entryIds)) {
             $entryIds = array('NOT_EXIST');
         }
         $captionAssetItemCoreFilter->setEntryIdIn($entryIds);
     }
     $captionAssetItemCriteria = KalturaCriteria::create(CaptionAssetItemPeer::OM_CLASS);
     $captionAssetItemCoreFilter->attachToCriteria($captionAssetItemCriteria);
     $captionAssetItemPager->attachToCriteria($captionAssetItemCriteria);
     $dbList = CaptionAssetItemPeer::doSelect($captionAssetItemCriteria);
     $list = KalturaCaptionAssetItemArray::fromDbArray($dbList, $this->getResponseProfile());
     $response = new KalturaCaptionAssetItemListResponse();
     $response->objects = $list;
     $response->totalCount = $captionAssetItemCriteria->getRecordsCount();
     return $response;
 }