本文整理汇总了PHP中Propel\Tests\Bookstore\Author::getBooksJoinPublisher方法的典型用法代码示例。如果您正苦于以下问题:PHP Author::getBooksJoinPublisher方法的具体用法?PHP Author::getBooksJoinPublisher怎么用?PHP Author::getBooksJoinPublisher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Tests\Bookstore\Author
的用法示例。
在下文中一共展示了Author::getBooksJoinPublisher方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNewObjectsGetLostOnJoin
public function testNewObjectsGetLostOnJoin()
{
/* While testNewObjectsAvailableWhenSaveNotCalled passed as of
revision 851, in this case we call getBooksJoinPublisher() instead
of just getBooks(). get...Join...() does not contain the check whether
the current object is new, it will always consult the DB and lose the
new objects entirely. Thus the test fails. (At least for Propel 1.2 ?!?) */
$this->markTestSkipped();
$a = new Author();
$a->setFirstName("Douglas");
$a->setLastName("Adams");
$p = new Publisher();
$p->setName('Pan Books Ltd.');
$b1 = new Book();
$b1->setTitle("The Hitchhikers Guide To The Galaxy");
$b1->setISBN('FA404-1');
$b1->setPublisher($p);
// uh... did not check that :^)
$a->addBook($b1);
$b2 = new Book();
$b2->setTitle("The Restaurant At The End Of The Universe");
$b1->setISBN('FA404-2');
$b2->setPublisher($p);
$a->addBook($b2);
$books = $a->getBooksJoinPublisher();
$this->assertEquals(2, count($books));
$this->assertContains($b1, $books);
$this->assertContains($b2, $books);
$a->save();
$this->assertFalse($b1->isNew());
$this->assertFalse($b2->isNew());
}