public function fromArray($arr) { foreach ($arr as $obj) { $nObj = new KalturaMediaEntryFilterForPlaylist(); $nObj->fromObject($obj); $newArr[] = $nObj; } return $newArr; }
public static function fromDbArray(array $arr = null, KalturaDetachedResponseProfile $responseProfile = null) { foreach ($arr as $obj) { $nObj = new KalturaMediaEntryFilterForPlaylist(); $nObj->fromObject($obj, $responseProfile); $newArr[] = $nObj; } return $newArr; }
public function playlistContentXmlToFilters() { list($totalResults, $listOfFilters) = myPlaylistUtils::getPlaylistFilterListStruct($this->playlistContent); // $totalResults is SimpleXMLElement $this->filters = new KalturaMediaEntryFilterForPlaylistArray(); foreach ($listOfFilters as $entryFilterXml) { $entryFilter = new entryFilter(); $entryFilter->fillObjectFromXml($entryFilterXml, "_"); $filter = new KalturaMediaEntryFilterForPlaylist(); $filter->fromObject($entryFilter); $this->filters[] = $filter; } $this->totalResults = (int) $totalResults; // will cast SimpleXMLElement correctly }
/** * Retrieve playlist for playing purpose * @disableTags TAG_WIDGET_SESSION * * @action execute * @param string $id * @param string $detailed * @param KalturaContext $playlistContext * @param KalturaMediaEntryFilterForPlaylist $filter * @param KalturaFilterPager $pager * @return KalturaBaseEntryArray */ function executeAction($id, $detailed = false, KalturaContext $playlistContext = null, $filter = null, $pager = null) { myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3; $playlist = entryPeer::retrieveByPK($id); if (!$playlist) { throw new KalturaAPIException(APIErrors::INVALID_ENTRY_ID, "Playlist", $id); } if ($playlist->getType() != entryType::PLAYLIST) { throw new KalturaAPIException(APIErrors::INVALID_PLAYLIST_TYPE); } $entryFilter = null; if ($filter) { $coreFilter = new entryFilter(); $filter->toObject($coreFilter); $entryFilter = $coreFilter; } if ($this->getKs() && is_object($this->getKs()) && $this->getKs()->isAdmin()) { myPlaylistUtils::setIsAdminKs(true); } $corePlaylistContext = null; if ($playlistContext) { $corePlaylistContext = $playlistContext->toObject(); myPlaylistUtils::setPlaylistContext($corePlaylistContext); } // the default of detrailed should be true - most of the time the kuse is needed if (is_null($detailed)) { $detailed = true; } try { $entryList = myPlaylistUtils::executePlaylist($this->getPartnerId(), $playlist, $entryFilter, $detailed, $pager); } catch (kCoreException $ex) { throw $ex; } myEntryUtils::updatePuserIdsForEntries($entryList); return KalturaBaseEntryArray::fromDbArray($entryList, $this->getResponseProfile()); }
/** * Retrieve playlist for playing purpose * * @param string $id * @param string $detailed * @param KalturaContext $playlistContext * @param KalturaMediaEntryFilterForPlaylist $filter * @return array */ function execute($id, $detailed = "", KalturaContext $playlistContext = null, KalturaMediaEntryFilterForPlaylist $filter = null) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "detailed", $detailed); if ($playlistContext !== null) { $this->client->addParam($kparams, "playlistContext", $playlistContext->toParams()); } if ($filter !== null) { $this->client->addParam($kparams, "filter", $filter->toParams()); } $this->client->queueServiceActionCall("playlist", "execute", $kparams); if ($this->client->isMultiRequest()) { return $this->client->getMultiRequestResult(); } $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "array"); return $resultObject; }