本文整理汇总了PHP中WebPage::isNewRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP WebPage::isNewRecord方法的具体用法?PHP WebPage::isNewRecord怎么用?PHP WebPage::isNewRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebPage
的用法示例。
在下文中一共展示了WebPage::isNewRecord方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_should_find_by_id_string
public function test_should_find_by_id_string()
{
$attributes = array('title' => 'UserMinds.com');
$UserMinds = $this->WebPage->create($attributes);
$FoundUserMinds = new WebPage((string) $UserMinds->getId());
$this->assertFalse($FoundUserMinds->isNewRecord());
$this->assertEqual($FoundUserMinds->getId(), $UserMinds->getId());
$FoundUserMinds = $UserMinds->find((string) $UserMinds->getId());
$this->assertFalse($FoundUserMinds->isNewRecord());
$this->assertEqual($FoundUserMinds->getId(), $UserMinds->getId());
}
示例2: test_should_destroy_record
public function test_should_destroy_record()
{
$WebPage = new WebPage(array('body' => 'Akelos PHP framework'));
$WebPage->save();
$WebPage2 = new WebPage($WebPage->getId());
$this->assertEqual($WebPage->body, $WebPage2->body);
$WebPage2->destroy();
$WebPage2 = new WebPage($WebPage->getId());
$this->assertTrue($WebPage2->isNewRecord());
$this->assertFalse($WebPage->find($WebPage->getId()));
}