protected function validateEntry($entry)
 {
     myPlaylistUtils::validatePlaylist($entry);
     // this is a small hack - to use this hook to update the count, countDate & the lengthInMsecs for the playlist
     // only if set "update_stats"
     if ($this->getP("update_stats")) {
         myPlaylistUtils::updatePlaylistStatistics($entry->getPartnerId(), $entry);
     }
 }
 protected function validateEntry($entry)
 {
     myPlaylistUtils::validatePlaylist($entry);
     // this is a small hack - to use this hook to update the count, countDate & the lengthInMsecs for the playlist
     // only if set "update_stats"
     $update_stats = $this->getP("update_stats");
     if ($update_stats == "false" || $update_stats === "0") {
         $update_stats = false;
     }
     if ($update_stats) {
         myPlaylistUtils::updatePlaylistStatistics($entry->getPartnerId(), $entry);
     }
     $entry->setDisplayInSearch(2);
     // make all the playlist entries PUBLIC !
 }
 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     // TODO -  verify permissions for viewing lists
     $detailed = $this->getP("detailed", false);
     // fill the playlist (infact only the mediaType and contentData are important
     $playlist = new entry();
     $playlist->setType(entryType::PLAYLIST);
     // prepare the playlist type before filling from request
     $obj_wrapper = objectWrapperBase::getWrapperClass($playlist, 0);
     $playlist->setMediaType($this->getP("playlist_mediaType"));
     $data_content = $this->getP("playlist_dataContent");
     $playlist->setDataContent($data_content);
     myPlaylistUtils::updatePlaylistStatistics($partner_id, $playlist);
     $level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
     $wrapper = objectWrapperBase::getWrapperClass($playlist, $level);
     $this->addMsg("playlist", $wrapper);
 }
 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     // TODO -  verify permissions for viewing lists
     $detailed = $this->getP("detailed", false);
     $limit = $this->getP("page_size", 10);
     $limit = $this->maxPageSize($limit);
     $page = $this->getP("page", 1);
     $user_filter_prefix = $this->getP("fp", "filter");
     $offset = ($page - 1) * $limit;
     // TODO - should limit search to partner ??
     //		kuserPeer::setUseCriteriaFilter( false );
     //		entryPeer::setUseCriteriaFilter( false );
     $input_params = $this->getInputParams();
     // fill the playlist (infact only the mediaType and contentData are important
     $playlist = new entry();
     $playlist->setType(entryType::PLAYLIST);
     // prepare the playlist type before filling from request
     $obj_wrapper = objectWrapperBase::getWrapperClass($playlist, 0);
     $playlist->setMediaType($this->getP("playlist_mediaType"));
     $data_content = $this->getP("playlist_dataContent");
     $playlist->setDataContent($data_content);
     // rest is similar to the executeplaylist service
     $extra_filters = array();
     for ($i = 1; $i < self::MAX_FILTER_COUNT; $i++) {
         // filter
         $extra_filter = new entryFilter();
         $fields_set = $extra_filter->fillObjectFromRequest($input_params, "{$user_filter_prefix}{$i}_", null);
         $extra_filters[$i] = $extra_filter;
     }
     //$entry_list = myPlaylistUtils::executePlaylist ( $partner_id , $playlist , $extra_filters , $detailed );
     myPlaylistUtils::updatePlaylistStatistics($partner_id, $playlist);
     //, $extra_filters , $detailed );
     $level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
     $wrapper = objectWrapperBase::getWrapperClass($playlist, $level);
     $this->addMsg("playlist", $wrapper);
 }
Exemple #5
0
 /**
  * Retrieve playlist statistics
  *
  * @action getStatsFromContent
  * @param KalturaPlaylistType $playlistType
  * @param string $playlistContent
  * @return KalturaPlaylist
  */
 function getStatsFromContentAction($playlistType, $playlistContent)
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
     $dbPlaylist = new entry();
     $dbPlaylist->setId(-1);
     // set with some dummy number so the getDataContent will later work properly
     $dbPlaylist->setType(entryType::PLAYLIST);
     // prepare the playlist type before filling from request
     $dbPlaylist->setMediaType($playlistType);
     $dbPlaylist->setDataContent($playlistContent);
     myPlaylistUtils::updatePlaylistStatistics($this->getPartnerId(), $dbPlaylist);
     //, $extra_filters , $detailed );
     $playlist = new KalturaPlaylist();
     // start from blank
     $playlist->fromObject($dbPlaylist, $this->getResponseProfile());
     return $playlist;
 }