本文整理汇总了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();
}
示例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());
}