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


PHP Author::getAuthorId方法代碼示例

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


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

示例1: actionAuhtor

 public function actionAuhtor()
 {
     if ($this->session->isLoging()) {
         echo 'Вы уже авторизированны!';
         exit;
     }
     $Author = new Author();
     if ($Author->getOneAuthor($this->params['login'], $this->params['pass'])) {
         $this->session->set('loging', 'loging');
         $this->session->set('author_id', $Author->getAuthorId());
         $this->session->set('login', $Author->getLogin());
         $this->session->set('pass', $Author->getPass());
         $this->session->set('logo', $Author->getLogo());
         $this->session->set('name', $Author->getName());
     }
     $this->view = new View($this->params, PATH_VIEW_MESSAGE, 'welcom_tpl.php', false);
     $this->html->add('content', $this->view->render());
     $layout = new Layout($this->html->getArray());
     $layout->get();
 }
開發者ID:khoteevnd,項目名稱:mb,代碼行數:20,代碼來源:Controller_Author_class.php

示例2: testAnonymousSave

 public function testAnonymousSave()
 {
     $author = new Author();
     $author->setName('Phillip K. Dick');
     $book = new Book();
     $book->setTitle('Minority Report');
     $book2 = new Book();
     $book2->setTitle('Do Androids Dream of Electric Sheep');
     // $library = new Library();
     // $library->setName('Travis County Reader');
     $author->addBook($book);
     $author->addBook($book2);
     $this->assertEqual(count($author->getBook_Collection()), 2);
     // $book2library = new Book2library();
     // $book2library->setLibrary_Object($library);
     // $book->addBook2library($book2library);
     // $book2->addBook2library($book2library);
     // $this->db->getDb()->startLoggingQueries();
     $author->save();
     // $this->dump($author->getBook_Collection());
     // print_r($this->db->getDb()->getQueryLog());
     $this->assertNotNull($author->getAuthorId());
     $this->assertNotNull($book->getBookId());
     $this->assertNotNull($book->getAuthorId());
     $this->assertIdentical($book->getAuthorId(), $author->getAuthorId());
     $this->assertNotNull($book2->getBookId());
     $this->assertNotNull($book2->getAuthorId());
     $this->assertIdentical($book2->getAuthorId(), $author->getAuthorId());
 }
開發者ID:jmhobbs,項目名稱:MkLst,代碼行數:29,代碼來源:TestCoughObject.class.php


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