本文整理汇总了PHP中myPartnerUtils::getDefaultKshow方法的典型用法代码示例。如果您正苦于以下问题:PHP myPartnerUtils::getDefaultKshow方法的具体用法?PHP myPartnerUtils::getDefaultKshow怎么用?PHP myPartnerUtils::getDefaultKshow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myPartnerUtils
的用法示例。
在下文中一共展示了myPartnerUtils::getDefaultKshow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$kshow_id = $this->getP("kshow_id", kshow::KSHOW_ID_USE_DEFAULT);
$entry = null;
if ($kshow_id == kshow::KSHOW_ID_USE_DEFAULT) {
// see if the partner has some default kshow to add to
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser);
if ($kshow) {
$kshow_id = $kshow->getId();
}
} elseif ($kshow_id == kshow::KSHOW_ID_CREATE_NEW) {
// if the partner allows - create a new kshow
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser, null, true);
if ($kshow) {
$kshow_id = $kshow->getId();
$entry = $kshow->getShowEntry();
// use the newly created kshow's roughcut
}
} else {
$kshow = kshowPeer::retrieveByPK($kshow_id);
}
if (!$kshow) {
// the partner is attempting to add an entry to some invalid or non-existing kwho
$this->addError(APIErrors::INVALID_KSHOW_ID, $kshow_id);
return;
}
if (!$entry) {
$entry = $kshow->createEntry(entry::ENTRY_MEDIA_TYPE_SHOW, $kshow->getProducerId(), "&auto_edit.jpg", "");
}
$obj_wrapper = objectWrapperBase::getWrapperClass($entry, 0);
$fields_modified = baseObjectUtils::fillObjectFromMap($this->getInputParams(), $entry, $this->getObjectPrefix() . "_", array("name", "tags", "groupId", "partnerData", "permissions", "screenName", "description", "indexedCustomData1"));
$entry->save();
$this->addMsg($this->getObjectPrefix(), objectWrapperBase::getWrapperClass($entry, objectWrapperBase::DETAIL_LEVEL_REGULAR));
$this->addDebug("added_fields", $fields_modified);
}
示例2: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$kshow_id = $this->getPM("kshow_id");
$detailed = $this->getP("detailed", false);
$kshow_indexedCustomData3 = $this->getP("indexedCustomData3");
$kshow = null;
if ($kshow_id == kshow::KSHOW_ID_USE_DEFAULT) {
// see if the partner has some default kshow to add to
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser);
if ($kshow) {
$kshow_id = $kshow->getId();
}
} elseif ($kshow_id) {
$kshow = kshowPeer::retrieveByPK($kshow_id);
} elseif ($kshow_indexedCustomData3) {
$kshow = kshowPeer::retrieveByIndexedCustomData3($kshow_indexedCustomData3);
}
if (!$kshow) {
$this->addError(APIErrors::INVALID_KSHOW_ID, $kshow_id);
} else {
$level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
$wrapper = objectWrapperBase::getWrapperClass($kshow, $level);
// TODO - remove this code when cache works properly when saving objects (in their save method)
$wrapper->removeFromCache("kshow", $kshow_id);
$this->addMsg("kshow", $wrapper);
}
}
示例3: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
// get the new properties for the kuser from the request
$dvd_entry = new entry();
$this->getTypeAndMediaType($dvd_entry);
// important to set type before the auto-fill so the setDataContent will work properly
$dvd_entry->setLengthInMsecs(0);
$obj_wrapper = objectWrapperBase::getWrapperClass($dvd_entry, 0);
$fields_modified = baseObjectUtils::fillObjectFromMap($this->getInputParams(), $dvd_entry, $this->getObjectPrefix() . "_", $obj_wrapper->getUpdateableFields());
// check that mandatory fields were set
// TODO
$new_widget = null;
if (count($fields_modified) > 0) {
$kshow_id = $this->getP("kshow_id", kshow::KSHOW_ID_USE_DEFAULT);
if ($kshow_id == kshow::KSHOW_ID_USE_DEFAULT) {
// see if the partner has some default kshow to add to
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser);
if ($kshow) {
$kshow_id = $kshow->getId();
}
} elseif ($kshow_id == kshow::KSHOW_ID_CREATE_NEW) {
// if the partner allows - create a new kshow
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser, null, true);
if ($kshow) {
$kshow_id = $kshow->getId();
}
} else {
$kshow = kshowPeer::retrieveByPK($kshow_id);
}
if (!$kshow) {
// the partner is attempting to add an entry to some invalid or non-existing kwho
$this->addError(APIErrors::INVALID_KSHOW_ID, $kshow_id);
return;
}
// force the type and media type
// TODO - set the kshow to some default kshow of the partner - maybe extract it from the custom_data of this specific partner
$dvd_entry->setKshowId($kshow_id);
$dvd_entry->setStatus(entryStatus::READY);
$dvd_entry->setPartnerId($partner_id);
$dvd_entry->setSubpId($subp_id);
$dvd_entry->setKuserId($puser_kuser->getKuserId());
$dvd_entry->setCreatorKuserId($puser_kuser->getKuserId());
$dvd_entry->save();
$this->addMsg($this->getObjectPrefix(), objectWrapperBase::getWrapperClass($dvd_entry, objectWrapperBase::DETAIL_LEVEL_DETAILED));
$this->addDebug("added_fields", $fields_modified);
} else {
$this->addError(APIErrors::NO_FIELDS_SET_FOR_GENERIC_ENTRY, $this->getObjectPrefix());
}
}
示例4: getKshow
protected function getKshow($partner_id, $subp_id, $puser_kuser, $kshow_id, $entry)
{
if ($kshow_id == kshow::KSHOW_ID_USE_DEFAULT) {
// see if the partner has some default kshow to add to
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser);
if ($kshow) {
$kshow_id = $kshow->getId();
}
} elseif ($kshow_id == kshow::KSHOW_ID_CREATE_NEW) {
// if the partner allows - create a new kshow
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser, null, true);
if ($kshow) {
$kshow_id = $kshow->getId();
}
} else {
$kshow = kshowPeer::retrieveByPK($kshow_id);
}
if (!$kshow) {
// the partner is attempting to add an entry to some invalid or non-existing kwho
$this->addError(APIErrors::INVALID_KSHOW_ID, $kshow_id);
return;
}
return $kshow;
}
示例5: executeImpl
/**
Will allow creation of multiple entries
ASSUME - the prefix of the entries is entryX_ where X is the index starting at 1
*/
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
// $logger = sfLogger::getInstance();
self::$escape_text = true;
/* if ( !$puser_kuser )
{
$this->addError( "No such user ..." );
return;
}
*/
// TODO - validate if the user can add entries to this kshow
$kshow_id = $this->getP("kshow_id");
$show_entry_id = $this->getP("show_entry_id");
$conversion_quality = $this->getP("conversionquality");
// must be all lower case
// for now - by default use quick_edit
$partner = PartnerPeer::retrieveByPK($partner_id);
for ($i = 0; $i <= $partner->getAddEntryMaxFiles(); ++$i) {
if ($i == 0) {
$prefix = $this->getObjectPrefix() . "_";
} else {
$prefix = $this->getObjectPrefix() . "{$i}" . "_";
}
$source = $this->getP($prefix . "source");
$filename = $this->getP($prefix . "filename");
if ($source != entry::ENTRY_MEDIA_SOURCE_WEBCAM || !$filename) {
continue;
}
$content = myContentStorage::getFSContentRootPath();
$entryFullPath = "{$content}/content/webcam/{$filename}.flv";
if (!file_exists($entryFullPath)) {
$remoteDCHost = kDataCenterMgr::getRemoteDcExternalUrlByDcId(1 - kDataCenterMgr::getCurrentDcId());
if ($remoteDCHost) {
kFileUtils::dumpApiRequest($remoteDCHost);
}
$this->addError(APIErrors::INVALID_FILE_NAME, $filename);
return;
}
}
if (strpos($kshow_id, 'entry-') !== false && !$show_entry_id) {
$show_entry_id = substr($kshow_id, 6);
}
$screen_name = $this->getP("screen_name");
$site_url = $this->getP("site_url");
$null_kshow = true;
if ($show_entry_id) {
// in this case we have the show_entry_id (of the relevant roughcut) - it suppresses the kshow_id
$show_entry = entryPeer::retrieveByPK($show_entry_id);
if ($show_entry) {
$kshow_id = $show_entry->getKshowId();
} else {
$kshow_id = null;
}
}
if ($kshow_id === kshow::SANDBOX_ID) {
$this->addError(APIErrors::SANDBOX_ALERT);
return;
}
$default_kshow_name = $this->getP("entry_name", null);
if (!$default_kshow_name) {
$default_kshow_name = $this->getP("entry1_name", null);
}
if ($kshow_id == kshow::KSHOW_ID_USE_DEFAULT) {
// see if the partner has some default kshow to add to
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser, null, false, $default_kshow_name);
$null_kshow = false;
if ($kshow) {
$kshow_id = $kshow->getId();
}
} elseif ($kshow_id == kshow::KSHOW_ID_CREATE_NEW) {
// if the partner allows - create a new kshow
$kshow = myPartnerUtils::getDefaultKshow($partner_id, $subp_id, $puser_kuser, null, true, $default_kshow_name);
$null_kshow = false;
if ($kshow) {
$kshow_id = $kshow->getId();
}
} else {
$kshow = kshowPeer::retrieveByPK($kshow_id);
}
if (!$kshow) {
// the partner is attempting to add an entry to some invalid or non-existing kwho
$this->addError(APIErrors::INVALID_KSHOW_ID, $kshow_id);
return;
}
// find permissions from kshow
$permissions = $kshow->getPermissions();
$kuser_id = $puser_kuser->getKuserId();
// TODO - once the CW
$quick_edit = myPolicyMgr::getPolicyFor("allowQuickEdit", $kshow, $partner);
// let the user override the quick_edit propery
if ($this->getP("quick_edit") == '0' || $this->getP("quick_edit") == "false") {
$quick_edit = false;
}
if ($quick_edit == '0' || $quick_edit === "false" || !$quick_edit || $quick_edit == false) {
KalturaLog::err('$quick_edit: [' . $quick_edit . ']');
//.........这里部分代码省略.........