本文整理汇总了PHP中Alias::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Alias::create方法的具体用法?PHP Alias::create怎么用?PHP Alias::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alias
的用法示例。
在下文中一共展示了Alias::create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Publication
}
$publicationObj = new Publication($cPub);
$backLink = "/{$ADMIN}/pub/add_alias.php?Pub={$cPub}";
$correct = true;
$created = false;
$errorMsgs = array();
if (empty($cName)) {
$correct = false;
$errorMsgs[] = $translator->trans('You must fill in the $1 field.', array('$1' => '<B>Name</B>'));
}
$aliases = 0;
if ($correct) {
$aliasDups = count(Alias::GetAliases(null, null, $cName));
if ($aliasDups <= 0) {
$newAlias = new Alias();
$created = $newAlias->create(array('Name' => "{$cName}", "IdPublication" => "{$cPub}"));
if ($created) {
$cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
$cacheService->clearNamespace('publication');
camp_html_goto_page("/{$ADMIN}/pub/aliases.php?Pub={$cPub}");
}
} else {
$errorMsgs[] = $translator->trans('Another alias with the same name exists already.', array(), 'pub');
}
}
if (!$created && !$correct) {
$errorMsgs[] = $translator->trans('The site alias $1 could not be added.', array('$1' => '<B>' . $cName . '</B>'), 'pub');
}
$crumbs = array($translator->trans("Publication Aliases", array(), 'pub') => "aliases.php?Pub={$cPub}");
camp_html_content_top($translator->trans("Adding new alias", array(), 'pub'), array("Pub" => $publicationObj), true, false, $crumbs);
?>
示例2: array
$backLink = "/$ADMIN/pub/add_alias.php?Pub=$cPub";
$correct = true;
$created = false;
$errorMsgs = array();
if (empty($cName)) {
$correct = false;
$errorMsgs[] = getGS('You must fill in the $1 field.', '<B>Name</B>');
}
$aliases = 0;
if ($correct) {
$aliasDups = count(Alias::GetAliases(null, null, $cName));
if ($aliasDups <= 0) {
$newAlias = new Alias();
$created = $newAlias->create(array('Name' => "$cName", "IdPublication" => "$cPub"));
if ($created) {
$logtext = getGS('The site alias "$1" has been added to publication "$2".',
$cName, $publicationObj->getName());
Log::Message($logtext, $g_user->getUserId(), 151);
camp_html_goto_page("/$ADMIN/pub/aliases.php?Pub=$cPub");
}
}
else {
$errorMsgs[] = getGS('Another alias with the same name exists already.');
}
}
if (!$created && !$correct) {
$errorMsgs[] = getGS('The site alias $1 could not be added.', '<B>'.$cName.'</B>');
}
示例3: Alias
if (empty($f_default_alias)) {
camp_html_add_msg(getGS('You must fill in the $1 field.','<B>'.getGS('Site').'</B>'));
}
if (camp_html_has_msgs()) {
camp_html_goto_page($backLink);
}
camp_is_alias_conflicting($f_default_alias);
camp_is_publication_conflicting($f_name);
if (camp_html_has_msgs()) {
camp_html_goto_page($backLink);
}
$alias = new Alias();
$alias->create(array('Name' => $f_default_alias));
$publicationObj = new Publication();
$columns = array('Name' => $f_name,
'IdDefaultAlias'=> $alias->getId(),
'IdDefaultLanguage' => $f_language,
'IdURLType' => $f_url_type,
'url_error_tpl_id' => $f_url_error_tpl_id,
'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,