当前位置: 首页>>代码示例>>PHP>>正文


PHP Author::getLastName方法代码示例

本文整理汇总了PHP中Author::getLastName方法的典型用法代码示例。如果您正苦于以下问题:PHP Author::getLastName方法的具体用法?PHP Author::getLastName怎么用?PHP Author::getLastName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Author的用法示例。


在下文中一共展示了Author::getLastName方法的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: testInvalidCharset

 public function testInvalidCharset()
 {
     $this->markTestSkipped();
     $db = Propel::getDB(BookPeer::DATABASE_NAME);
     if ($db instanceof DBSQLite) {
         $this->markTestSkipped();
     }
     $a = new Author();
     $a->setFirstName("Б.");
     $a->setLastName("АКУНИН");
     $a->save();
     $authorNameWindows1251 = iconv("utf-8", "windows-1251", $a->getLastName());
     $a->setLastName($authorNameWindows1251);
     // Different databases seem to handle invalid data differently (no surprise, I guess...)
     if ($db instanceof DBPostgres) {
         try {
             $a->save();
             $this->fail("Expected an exception when saving non-UTF8 data to database.");
         } catch (Exception $x) {
             print $x;
         }
     } else {
         // No exception is thrown by MySQL ... (others need to be tested still)
         $a->save();
         $a->reload();
         $this->assertEquals("", $a->getLastName(), "Expected last_name to be empty (after inserting invalid charset data)");
     }
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:28,代码来源:CharacterEncodingTest.php

示例3: testSetLastName

 function testSetLastName()
 {
     //Arrange
     $first_name = "J.K.";
     $last_name = "Rowling";
     $test_author = new Author($first_name, $last_name);
     //Act
     $test_author->setLastName("Rowling");
     $result = $test_author->getLastName();
     //Assert
     $this->assertEquals("Rowling", $result);
 }
开发者ID:jtorrespdx,项目名称:library,代码行数:12,代码来源:AuthorTest.php

示例4: AuthorBiography

        $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>
    <li><a href="#biographyContainer"><?php putGS('Biography'); ?></a></li>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:detail.php

示例5: showFamilyName

 /**
  * @return string
  */
 public function showFamilyName()
 {
     return $this->html($this->author->getLastName());
 }
开发者ID:arkuuu,项目名称:publin,代码行数:7,代码来源:AuthorView.php


注:本文中的Author::getLastName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。