本文整理匯總了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.");
}