setName() public method

Set the type name for the given language. A new entry in the database will be created if the language does not exist.
public setName ( integer $p_languageId, string $p_value ) : boolean
$p_languageId integer
$p_value string
return boolean
Example #1
0
$created = false;
//$topicParent = new Topic($f_topic_parent_id);
//$Path = camp_topic_path($topicParent, $f_topic_language_id);

$errorMsgs = array();


if ($f_type_language_id <= 0) {
	$correct = false;
	$errorMsgs[] = getGS('You must choose a language for the article type.');
}

if ($correct) {
	// Translate existing type
	$type = new ArticleType($f_type_id);
	$created = $type->setName($f_type_language_id, $f_type_translation_name);
	if ($created) {
		camp_html_goto_page("/$ADMIN/article_types/index.php");
	}
	else {
		$errorMsgs[] = getGS('The translation could not be added.');
	}
}

$crumbs = array();
$crumbs[] = array(getGS("Configure"), "");
$crumbs[] = array(getGS("Article Types"), "/$ADMIN/article_types/");
$crumbs[] = array(getGS("Adding new article type"), "");

echo camp_html_breadcrumbs($crumbs);