/**
  * List Flavor Assets by filter and pager
  * 
  * @action list
  * @param KalturaAssetFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaFlavorAssetListResponse
  */
 function listAction(KalturaAssetFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (!$filter) {
         $filter = new KalturaAssetFilter();
     }
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     $flavorAssetFilter = new AssetFilter();
     $filter->toObject($flavorAssetFilter);
     $c = new Criteria();
     $flavorAssetFilter->attachToCriteria($c);
     $totalCount = flavorAssetPeer::doCount($c);
     $pager->attachToCriteria($c);
     $dbList = flavorAssetPeer::doSelect($c);
     $list = KalturaFlavorAssetArray::fromDbArray($dbList);
     $response = new KalturaFlavorAssetListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }
 function listAction(KalturaAssetFilter $filter = null, KalturaFilterPager $pager = null)
 {
     $kparams = array();
     if ($filter !== null) {
         $this->client->addParam($kparams, "filter", $filter->toParams());
     }
     if ($pager !== null) {
         $this->client->addParam($kparams, "pager", $pager->toParams());
     }
     $this->client->queueServiceActionCall("thumbasset", "list", $kparams);
     if ($this->client->isMultiRequest()) {
         return null;
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaThumbAssetListResponse");
     return $resultObject;
 }
 /**
  * List attachment Assets by filter and pager
  * 
  * @action list
  * @param KalturaAssetFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaAttachmentAssetListResponse
  */
 function listAction(KalturaAssetFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (!$filter) {
         $filter = new KalturaAssetFilter();
     }
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     $attachmentAssetFilter = new AssetFilter();
     $filter->toObject($attachmentAssetFilter);
     $c = new Criteria();
     $attachmentAssetFilter->attachToCriteria($c);
     $types = KalturaPluginManager::getExtendedTypes(assetPeer::OM_CLASS, AttachmentPlugin::getAssetTypeCoreValue(AttachmentAssetType::ATTACHMENT));
     $c->add(assetPeer::TYPE, $types, Criteria::IN);
     $totalCount = assetPeer::doCount($c);
     $pager->attachToCriteria($c);
     $dbList = assetPeer::doSelect($c);
     $list = KalturaAttachmentAssetArray::fromDbArray($dbList);
     $response = new KalturaAttachmentAssetListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }
 public function getOrderByMap()
 {
     return array_merge(parent::getOrderByMap(), $this->order_by_map);
 }
 public function getOrderByMap()
 {
     return array_merge(parent::getOrderByMap(), self::$order_by_map);
 }
 /**
  * List Flavor Assets by filter and pager
  * 
  * @action list
  * @param KalturaAssetFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaFlavorAssetListResponse
  */
 function listAction(KalturaAssetFilter $filter = null, KalturaFilterPager $pager = null)
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
     if (!$filter) {
         $filter = new KalturaAssetFilter();
     }
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     // verify access to the relevant entries - either same partner as the KS or kaltura network
     if ($filter->entryIdEqual) {
         $entryIds = array($filter->entryIdEqual);
     } else {
         if ($filter->entryIdIn) {
             $entryIds = explode(',', $filter->entryIdIn);
         } else {
             throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL, 'KalturaAssetFilter::entryIdEqual/KalturaAssetFilter::entryIdIn');
         }
     }
     $c = KalturaCriteria::create(entryPeer::OM_CLASS);
     $c->addAnd(entryPeer::ID, $entryIds, Criteria::IN);
     $criterionPartnerOrKn = $c->getNewCriterion(entryPeer::PARTNER_ID, $this->getPartnerId());
     $criterionPartnerOrKn->addOr($c->getNewCriterion(entryPeer::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK));
     $c->addAnd($criterionPartnerOrKn);
     KalturaCriterion::disableTag(KalturaCriterion::TAG_WIDGET_SESSION);
     $dbEntries = entryPeer::doSelect($c);
     KalturaCriterion::restoreTag(KalturaCriterion::TAG_WIDGET_SESSION);
     if (!$dbEntries) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, implode(',', $entryIds));
     }
     $entryIds = array();
     foreach ($dbEntries as $dbEntry) {
         $entryIds[] = $dbEntry->getId();
     }
     $filter->entryIdEqual = null;
     $filter->entryIdIn = implode(',', $entryIds);
     // get the flavors
     $flavorAssetFilter = new AssetFilter();
     $filter->toObject($flavorAssetFilter);
     $c = new Criteria();
     $flavorAssetFilter->attachToCriteria($c);
     $flavorTypes = KalturaPluginManager::getExtendedTypes(assetPeer::OM_CLASS, assetType::FLAVOR);
     $c->add(assetPeer::TYPE, $flavorTypes, Criteria::IN);
     $totalCount = assetPeer::doCount($c);
     $pager->attachToCriteria($c);
     $dbList = assetPeer::doSelect($c);
     $list = KalturaFlavorAssetArray::fromDbArray($dbList);
     $response = new KalturaFlavorAssetListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }