本文整理汇总了PHP中Partner::setCountry方法的典型用法代码示例。如果您正苦于以下问题:PHP Partner::setCountry方法的具体用法?PHP Partner::setCountry怎么用?PHP Partner::setCountry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Partner
的用法示例。
在下文中一共展示了Partner::setCountry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createNewPartner
private function createNewPartner($parnter_name, $contact, $email, $ID_is_for, $SDK_terms_agreement, $description, $website_url, $password = null, $partner = null)
{
$secret = md5($this->str_makerand(5, 10, true, false, true));
$admin_secret = md5($this->str_makerand(5, 10, true, false, true));
$newPartner = new Partner();
if ($parnter_name) {
$newPartner->setPartnerName($parnter_name);
}
$newPartner->setAdminSecret($admin_secret);
$newPartner->setSecret($secret);
$newPartner->setAdminName($contact);
$newPartner->setAdminEmail($email);
$newPartner->setUrl1($website_url);
if ($ID_is_for === "commercial_use" || $ID_is_for === CommercialUseType::COMMERCIAL_USE) {
$newPartner->setCommercialUse(true);
} else {
//($ID_is_for == "non-commercial_use") || $ID_is_for === CommercialUseType::NON_COMMERCIAL_USE)
$newPartner->setCommercialUse(false);
}
$newPartner->setDescription($description);
$newPartner->setKsMaxExpiryInSeconds(86400);
$newPartner->setModerateContent(false);
$newPartner->setNotify(false);
$newPartner->setAppearInSearch(mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK);
$newPartner->setIsFirstLogin(true);
/* fix drupal5 module partner type */
//var_dump($description);
if ($this->partnerParentId) {
// this is a child partner of some VAR/partner GROUP
$newPartner->setPartnerParentId($this->partnerParentId);
$newPartner->setMonitorUsage(0);
}
if (substr_count($description, 'Drupal module|')) {
$newPartner->setType(102);
if ($partner) {
$partner->setType(102);
}
}
if ($partner) {
if ($partner->getType()) {
$newPartner->setType($partner->getType());
}
if ($partner->getContentCategories()) {
$newPartner->setContentCategories($partner->getContentCategories());
}
if ($partner->getPhone()) {
$newPartner->setPhone($partner->getPhone());
}
if ($partner->getDescribeYourself()) {
$newPartner->setDescribeYourself($partner->getDescribeYourself());
}
if ($partner->getAdultContent()) {
$newPartner->setAdultContent($partner->getAdultContent());
}
if ($partner->getDefConversionProfileType()) {
$newPartner->setDefConversionProfileType($partner->getDefConversionProfileType());
}
// new fields of registration form
if ($partner->getFirstName()) {
$newPartner->setFirstName($partner->getFirstName());
}
if ($partner->getLastName()) {
$newPartner->setLastName($partner->getLastName());
}
if ($partner->getCountry()) {
$newPartner->setCountry($partner->getCountry());
}
if ($partner->getState()) {
$newPartner->setState($partner->getState());
}
if ($partner->getAdditionalParams() && is_array($partner->getAdditionalParams()) && count($partner->getAdditionalParams())) {
$newPartner->setAdditionalParams($partner->getAdditionalParams());
}
}
$newPartner->save();
// if name was left empty - which should not happen - use id as name
if (!$parnter_name) {
$parnter_name = $newPartner->getId();
}
$newPartner->setPartnerName($parnter_name);
$newPartner->setPrefix($newPartner->getId());
$newPartner->setPartnerAlias(md5($newPartner->getId() . 'kaltura partner'));
// set default conversion profile for trial accounts
if ($newPartner->getType() == Partner::PARTNER_TYPE_KMC) {
$newPartner->setDefConversionProfileType(ConversionProfile::DEFAULT_TRIAL_COVERSION_PROFILE_TYPE);
}
$newPartner->save();
$partner_id = $newPartner->getId();
widget::createDefaultWidgetForPartner($partner_id, $this->createNewSubPartner($newPartner));
$fromPartner = PartnerPeer::retrieveByPK(kConf::get("template_partner_id"));
if (!$fromPartner) {
KalturaLog::log("Template content partner was not found!");
} else {
myPartnerUtils::copyTemplateContent($fromPartner, $newPartner, true);
}
$newPartner->setKmcVersion(kConf::get('new_partner_kmc_version'));
$newPartner->save();
return $newPartner;
}