本文整理匯總了PHP中Publication::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Publication::update方法的具體用法?PHP Publication::update怎麽用?PHP Publication::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Publication
的用法示例。
在下文中一共展示了Publication::update方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$errorMsgs = array();
$updated = false;
if (empty($f_name)) {
camp_html_add_msg(getGS('You must fill in the $1 field.', '<B>' . getGS('Name') . '</B>'));
}
if (empty($f_default_alias)) {
camp_html_add_msg(getGS('You must fill in the $1 field.', '<B>' . getGS('Site') . '</B>'));
}
$publicationObj = new Publication($f_publication_id);
if (!$publicationObj->exists()) {
camp_html_add_msg(getGS('Publication does not exist.'));
}
if ($f_default_alias != $publicationObj->getDefaultAliasId()) {
camp_is_alias_conflicting($f_default_alias);
}
if ($f_name != $publicationObj->getName()) {
camp_is_publication_conflicting($f_name);
}
if (camp_html_has_msgs()) {
camp_html_goto_page($backLink);
}
//$publicationObj->setPublicComments($f_comments_public_enabled);
$columns = array('Name' => $f_name, 'IdDefaultAlias' => $f_default_alias, 'IdDefaultLanguage' => $f_language, 'IdURLType' => $f_url_type, 'TimeUnit' => $f_time_unit, 'PaidTime' => $f_paid, 'TrialTime' => $f_trial, 'UnitCost' => $f_unit_cost, 'UnitCostAllLang' => $f_unit_cost_all_lang, 'Currency' => $f_currency, 'comments_enabled' => $f_comments_enabled, 'comments_article_default_enabled' => $f_comments_article_default, 'comments_subscribers_moderated' => $f_comments_subscribers_moderated, 'comments_public_moderated' => $f_comments_public_moderated, 'comments_public_enabled' => $f_comments_public_enabled, 'comments_captcha_enabled' => $f_comments_captcha_enabled, 'comments_spam_blocking_enabled' => $f_comments_spam_blocking_enabled, 'comments_moderator_to' => $f_comments_moderator_to, 'comments_moderator_from' => $f_comments_moderator_from, 'seo' => serialize($f_seo));
$updated = $publicationObj->update($columns);
if ($updated) {
camp_html_add_msg(getGS("Publication updated"), "ok");
} else {
$errorMsg = getGS('The publication information could not be updated.');
camp_html_add_msg($errorMsg);
}
camp_html_goto_page($backLink);