本文整理汇总了PHP中Author::setType方法的典型用法代码示例。如果您正苦于以下问题:PHP Author::setType方法的具体用法?PHP Author::setType怎么用?PHP Author::setType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Author
的用法示例。
在下文中一共展示了Author::setType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Author
if ($id > 0) {
$author = new Author($id);
$isNewAuthor = false;
} else {
$author->create(array('first_name' => $first_name, 'last_name' => $last_name));
$isNewAuthor = true;
}
$uploadFileSpecified = isset($_FILES['file']) && isset($_FILES['file']['name']) && !empty($_FILES['file']['name']);
$author->setFirstName($first_name);
$author->setLastName($last_name);
$author->commit();
// Reset types
$types = Input::Get('type', 'array', array());
AuthorAssignedType::ResetAuthorAssignedTypes($author->getId());
foreach ($types as $type) {
$author->setType($type);
}
$author->setSkype(Input::Get('skype'));
$author->setJabber(Input::Get('jabber'));
$author->setAim(Input::Get('aim'));
$author->setEmail(Input::Get('email'));
$authorBiography = array();
$authorBiography['biography'] = Input::Get("txt_biography", "string");
$authorBiography['language'] = Input::Get("lang", "int", 0);
$authorBiography['first_name'] = Input::Get("lang_first_name");
$authorBiography['last_name'] = Input::Get("lang_last_name");
$author->setBiography($authorBiography);
if ($uploadFileSpecified) {
$attributes = array();
$image = Image::OnImageUpload($_FILES['file'], $attributes);
if (PEAR::isError($image)) {
示例2: setAuthor
/**
* Set the ID of the author who wrote this article.
*
* @param int $p_value
* @return boolean
*/
public function setAuthor(Author $p_author)
{
$defaultAuthorType = $p_author->setType();
// Links the author to the article
$articleAuthorObj = new ArticleAuthor($this->getArticleNumber(),
$this->getLanguageId(),
$p_author->getId(), $defaultAuthorType);
if (!$articleAuthorObj->exists()) {
$articleAuthorObj->create();
}
} // fn setAuthor
示例3: foreach
}
}
// Update the article author
if (!empty($f_article_author)) {
ArticleAuthor::OnArticleLanguageDelete($articleObj->getArticleNumber(), $articleObj->getLanguageId());
$i = 0;
foreach ($f_article_author as $author) {
$authorObj = new Author($author);
if (!$authorObj->exists() && strlen(trim($author)) > 0) {
$authorData = Author::ReadName($author);
$authorObj->create($authorData);
}
// Sets the author type selected
$author_type = $f_article_author_type[$i];
$authorObj->setType($author_type);
// Links the author to the article
$articleAuthorObj = new ArticleAuthor($articleObj->getArticleNumber(),
$articleObj->getLanguageId(),
$authorObj->getId(), $author_type);
if (!$articleAuthorObj->exists()) {
$articleAuthorObj->create();
}
$i++;
}
}
// Update the article.
$articleObj->setOnFrontPage(!empty($f_on_front_page));
$articleObj->setOnSectionPage(!empty($f_on_section_page));
$articleObj->setIsPublic(!empty($f_is_public));