當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Author::getFirstName方法代碼示例

本文整理匯總了PHP中Author::getFirstName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Author::getFirstName方法的具體用法?PHP Author::getFirstName怎麽用?PHP Author::getFirstName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Author的用法示例。


在下文中一共展示了Author::getFirstName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getAuthorsLink

 /**
  * Returns the link for given author and given service.
  *
  * @param Author $author  The author
  * @param string $service The service
  *
  * @return string
  */
 public static function getAuthorsLink(Author $author, $service)
 {
     switch ($service) {
         case 'Google Scholar':
             return 'http://scholar.google.com/scholar?q=' . urlencode($author->getFirstName() . ' ' . $author->getLastName());
             break;
         case 'BASE':
             return 'http://www.base-search.net/Search/Results?lookfor=aut:' . urlencode($author->getFirstName() . ' ' . $author->getLastName());
             break;
         default:
             return 'unknown service!';
             break;
     }
 }
開發者ID:arkuuu,項目名稱:publin,代碼行數:22,代碼來源:BibLink.php

示例2: testSetFirstName

 function testSetFirstName()
 {
     //Arrange
     $first_name = "J.K.";
     $last_name = "Rowling";
     $test_author = new Author($first_name, $last_name);
     //Act
     $test_author->setFirstName("J.K.");
     $result = $test_author->getFirstName();
     //Assert
     $this->assertEquals("J.K.", $result);
 }
開發者ID:jtorrespdx,項目名稱:library,代碼行數:12,代碼來源:AuthorTest.php

示例3: testTypeHintingValues

 public function testTypeHintingValues()
 {
     $test_name = 'test name';
     $a = new Author();
     $a2 = new Author();
     $a2->setFirstName($test_name);
     $a->setAge(2);
     $this->assertEquals(2, $a->getAge());
     $this->assertTrue(is_int($a->getAge()));
     $a->clear();
     $a->setAge('2');
     $this->assertEquals(2, $a->getAge());
     $this->assertTrue(is_int($a->getAge()));
     $a->clear();
     $a->setAge('wrong integer');
     $this->assertTrue(!is_int($a->getAge()));
     $a->clear();
     $a->setFirstName($test_name);
     $this->assertEquals($test_name, $a->getFirstName());
     $this->assertTrue(is_string($a->getFirstName()));
     $a->clear();
     $a->setFirstName($a2);
     $this->assertTrue(is_string($a->getFirstName()));
     $this->assertEquals($a->getFirstName(), (string) $a2);
     $a->clear();
     $a->setFirstName(true);
     $this->assertTrue(is_string($a->getFirstName()));
 }
開發者ID:dracony,項目名稱:forked-php-orm-benchmark,代碼行數:28,代碼來源:GeneratedObjectTest.php

示例4: AuthorBiography

        $json = '{"first_name":"","last_name":"","biography":""}';
        $language = Input::Get("language", "int", 0);
        $bioObj = new AuthorBiography($author->getId(), $language);
        if ($bioObj->exists()) {
            $json = '{"first_name":"'.addslashes($bioObj->getFirstName())
                .'","last_name":"'.addslashes($bioObj->getLastName())
                .'","biography":"'.addslashes($bioObj->getBiography())
                .'"}';
        }
        echo $json;
        exit();
    }
    if ($getNames == 1) {

    }
    $first_name = $author->getFirstName();
    $last_name = $author->getLastName();
    $type = $author->getType();
    $skype = $author->getSkype();
    $jabber = $author->getJabber();
    $aim = $author->getAim();
    $email = $author->getEmail();
    $aliases = $author->getAliases();
}
?>
<form method="post" enctype="multipart/form-data">
<?php echo SecurityToken::FormParameter(); ?>
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<div class="tabs authors ui-tabs ui-widget ui-widget-content ui-corner-all block-shadow author-details">
  <ul>
    <li><a href="#generalContainer"><?php putGS('General'); ?></a></li>
開發者ID:nistormihai,項目名稱:Newscoop,代碼行數:31,代碼來源:detail.php

示例5: showGivenName

 /**
  * @return string
  */
 public function showGivenName()
 {
     return $this->html($this->author->getFirstName());
 }
開發者ID:arkuuu,項目名稱:publin,代碼行數:7,代碼來源:AuthorView.php


注:本文中的Author::getFirstName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。