本文整理汇总了PHP中Propel\Tests\Bookstore\Book::getAuthor方法的典型用法代码示例。如果您正苦于以下问题:PHP Book::getAuthor方法的具体用法?PHP Book::getAuthor怎么用?PHP Book::getAuthor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Tests\Bookstore\Book
的用法示例。
在下文中一共展示了Book::getAuthor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDoSelectJoin_NullFk
/**
* Test the doSelectJoin*() methods when the related object is NULL.
*/
public function testDoSelectJoin_NullFk()
{
$b1 = new Book();
$b1->setTitle("Test NULLFK 1");
$b1->setISBN("NULLFK-1");
$b1->save();
$b2 = new Book();
$b2->setTitle("Test NULLFK 2");
$b2->setISBN("NULLFK-2");
$b2->setAuthor(new Author());
$b2->getAuthor()->setFirstName("Hans")->setLastName("L");
$b2->save();
BookPeer::clearInstancePool();
AuthorPeer::clearInstancePool();
$c = new Criteria();
$c->add(BookPeer::ISBN, 'NULLFK-%', Criteria::LIKE);
$c->addAscendingOrderByColumn(BookPeer::ISBN);
$matches = BookPeer::doSelectJoinAuthor($c);
$this->assertEquals(2, count($matches), "Expected 2 matches back from new books; got back " . count($matches));
$this->assertNull($matches[0]->getAuthor(), "Expected first book author to be null");
$this->assertInstanceOf('Propel\\Tests\\Bookstore\\Author', $matches[1]->getAuthor(), "Expected valid Author object for second book.");
}