本文整理汇总了PHP中entryFilter::fillObjectFromRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP entryFilter::fillObjectFromRequest方法的具体用法?PHP entryFilter::fillObjectFromRequest怎么用?PHP entryFilter::fillObjectFromRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entryFilter
的用法示例。
在下文中一共展示了entryFilter::fillObjectFromRequest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser, $create_cachekey = false)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
// 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 );
$playlist_id = $this->getPM("playlist_id");
$input_params = $this->getInputParams();
$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);
if ($fields_set) {
$extra_filters[$i] = $extra_filter;
}
}
// this service is executed twice! (first time for the cache key, second time for the execution)
if (is_null($this->playlist)) {
$playlist = entryPeer::retrieveByPK($playlist_id);
if (!$playlist) {
throw new APIException(APIErrors::INVALID_ENTRY_ID, "Playlist", $playlist_id);
}
myPartnerUtils::addPartnerToCriteria(new accessControlPeer(), $playlist->getPartnerId(), $this->getPrivatePartnerData(), $this->partnerGroup2(), null);
$this->playlist = $playlist;
}
if ($create_cachekey) {
if ($this->isAdmin()) {
return null;
}
$cache_key_arr = array("playlist_id" => $playlist_id, "filters" => $extra_filters);
$cahce_key = new executionCacheKey();
$cahce_key->expiry = 600;
$cahce_key->key = md5(print_r($cache_key_arr, true));
return $cahce_key;
}
if ($this->isAdmin()) {
myPlaylistUtils::setIsAdminKs(true);
}
$entry_list = myPlaylistUtils::executePlaylistById($partner_id, $playlist_id, $extra_filters, $detailed);
myEntryUtils::updatePuserIdsForEntries($entry_list);
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$wrapper = objectWrapperBase::getWrapperClass($entry_list, $level);
$this->addMsg("count", count($entry_list));
$this->addMsg($this->getObjectPrefix(), $wrapper);
}
示例2: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
// TODO - verify permissions for viewing lists
$detailed = $this->getP("detailed", false);
if (!$detailed) {
$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);
/*
$updateable_fields = $obj_wrapper->getUpdateableFields() ;
$fields_modified = baseObjectUtils::fillObjectFromMapOrderedByFields( $input_params , $playlist , "playlist_" ,
$updateable_fields , BasePeer::TYPE_PHPNAME ,false );
*/
// 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);
myEntryUtils::updatePuserIdsForEntries($entry_list);
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$wrapper = objectWrapperBase::getWrapperClass($entry_list, $level);
$this->addMsg("count", count($entry_list));
$this->addMsg($this->getObjectPrefix(), $wrapper);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:44,代码来源:executeplaylistfromcontentAction.class.php
示例3: executeImpl
/**
* This is not a regular service.
* Because the caller is not a partner but rather a 3rd party provider that wishs to query our system,
* The security is slightly different and the respons is in the format of mRss which is related to entries only.
*/
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
header("Content-Type: text/xml; charset=utf-8");
// TODO - verify permissions for viewing lists
// validate the ks of the caller
$code = $this->getP("code");
if ($code != 'fsalh5423a43g') {
return "<xml></xml>";
die;
}
$detailed = $this->getP("detailed", false);
$limit = $this->getP("page_size", 100);
$limit = $this->maxPageSize($limit);
$operated_partner_id = $this->getP("operated_partner_id");
$page = $this->getP("page", 1);
$offset = ($page - 1) * $limit;
// kuserPeer::setUseCriteriaFilter( false );
if ($operated_partner_id) {
entryPeer::setUseCriteriaFilter(true);
} else {
entryPeer::setUseCriteriaFilter(false);
}
// FOR now - display only 2 partners
// 2460 - dorimedia
$partner_list = array(593, 2460);
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
$c->addAnd(entryPeer::STATUS, entryStatus::READY);
// for now display only entries that are part of the kaltura network
// $c->addAnd ( entryPeer::DISPLAY_IN_SEARCH , mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK );
// filter
$filter = new entryFilter();
$fields_set = $filter->fillObjectFromRequest($this->getInputParams(), "filter_", null);
$this->setExtraFilters($filter);
$offset = ($page - 1) * $limit;
$c->setLimit($limit);
if ($offset > 0) {
$c->setOffset($offset);
}
$filter->attachToCriteria($c);
//if ($order_by != -1) entryPeer::setOrder( $c , $order_by );
$c->addAnd(entryPeer::PARTNER_ID, $partner_list, Criteria::IN);
$start_1 = microtime(true);
if ($detailed) {
// for some entry types - there are no kshow or kusers - don't join even when detailed
if ($this->joinOnDetailed()) {
$list = entryPeer::doSelectJoinAll($c);
} else {
$list = entryPeer::doSelect($c);
}
$level = objectWrapperBase::DETAIL_LEVEL_DETAILED;
} else {
$list = entryPeer::doSelect($c);
$level = objectWrapperBase::DETAIL_LEVEL_REGULAR;
}
$count = $c->getRecordsCount();
$end_1 = microtime(true);
KalturaLog::log("benchmark db: [" . ($end_1 - $start_1) . "]");
$result_count = count($list);
$start_2 = microtime(true);
$mrss_renderer = new kalturaRssRenderer(kalturaRssRenderer::TYPE_TABOOLA);
$str = $mrss_renderer->renderMrssFeed($list, $page, $result_count);
$end_2 = microtime(true);
KalturaLog::log("benchmark render: [" . ($end_2 - $start_2) . "]");
echo $str;
// don't return to the rest of the implementation - the base class manipulates the content.
die;
}
示例4: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
// TODO - verify permissions for viewing lists
$detailed = $this->getP("detailed", false);
$detailed_fields = $this->getP("detailed_fields");
$limit = $this->getP("page_size", 10);
$limit = $this->maxPageSize($limit);
$page = $this->getP("page", 1);
$offset = ($page - 1) * $limit;
kuserPeer::setUseCriteriaFilter(false);
//entryPeer::setUseCriteriaFilter( false );
$c = KalturaCriteria::create(entryPeer::OM_CLASS);
// filter
$filter = new entryFilter();
$fields_set = $filter->fillObjectFromRequest($this->getInputParams(), "filter_", null);
$this->setExtraFilters($filter);
$filter->setPartnerSearchScope(baseObjectFilter::MATCH_KALTURA_NETWORK_AND_PRIVATE);
$desired_status = "status:" . $filter->get("_eq_status") . "," . $filter->get("_in_status");
$display_deleted = $this->getP("display_deleted", false);
if ($display_deleted == "false") {
$display_deleted = false;
}
$pos = strpos($desired_status, entryStatus::DELETED);
if ($display_deleted || $pos !== false) {
entryPeer::allowDeletedInCriteriaFilter();
}
// hack for displaying pre-moderation
$moderation_status = $filter->get("_in_moderation_status");
if ($moderation_status && (strpos($moderation_status, "1,5") !== false || strpos($moderation_status, "5,1") !== false)) {
// this is when the KMC requests the moderated entries
$filter->set("_in_status", $filter->get("_in_status") . ",5");
// add the status '5'
}
$this->fixModerationStatusForBackwardCompatibility($filter);
$puser_kuser = null;
$use_filter_puser_id = $this->getP("use_filter_puser_id", 1);
if ($use_filter_puser_id == "false") {
$use_filter_puser_id = false;
}
if ($use_filter_puser_id) {
// if so - assume the producer_id is infact a puser_id and the kuser_id should be retrieved
$target_puser_id = $filter->get("_eq_user_id");
if ($target_puser_id !== null) {
$puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid($partner_id, null, $target_puser_id, false);
if ($puser_kuser) {
$filter->set("_eq_user_id", $puser_kuser->getkuserId());
// $this->setP ( "filter__eq_producer_id" , $puser_kuser->getkuserId() );
}
}
}
$offset = ($page - 1) * $limit;
$c->setLimit($limit);
if ($offset > 0) {
$c->setOffset($offset);
}
$filter->attachToCriteria($c);
// for some entry types - there are no kshow or kusers - don't join even when detailed
if ($this->joinOnDetailed()) {
$list = entryPeer::doSelectJoinKuser($c);
} else {
$list = entryPeer::doSelect($c);
}
if ($detailed) {
$level = objectWrapperBase::DETAIL_LEVEL_DETAILED;
} else {
$level = objectWrapperBase::DETAIL_LEVEL_REGULAR;
}
$count = $c->getRecordsCount();
$this->addMsg("count", $count);
$this->addMsg("page_size", $limit);
$this->addMsg("page", $page);
myEntryUtils::updatePuserIdsForEntries($list);
if ($detailed_fields) {
$extra_fields = explode(",", $detailed_fields);
$wrapper = objectWrapperBase::getWrapperClass($list, $level, objectWrapperBase::DETAIL_VELOCITY_DEFAULT, 0, $extra_fields);
} else {
$wrapper = objectWrapperBase::getWrapperClass($list, $level);
}
$this->addMsg($this->getObjectPrefix(), $wrapper);
if ($use_filter_puser_id) {
$this->addMsg("user", objectWrapperBase::getWrapperClass($puser_kuser, objectWrapperBase::DETAIL_LEVEL_REGULAR));
}
}