本文整理汇总了PHP中Pagina::addToSubpages方法的典型用法代码示例。如果您正苦于以下问题:PHP Pagina::addToSubpages方法的具体用法?PHP Pagina::addToSubpages怎么用?PHP Pagina::addToSubpages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pagina
的用法示例。
在下文中一共展示了Pagina::addToSubpages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSalvadoEnCascadaConLoop
public function testSalvadoEnCascadaConLoop()
{
/**
* Instancias:
* a1->a2
* a2->a3
* a3->a1
*/
$p1 = new Pagina(array("titulo" => "Pagina raiz", "contenido" => "This step is usually done transparently as most compilers perform it and then invoke the assembler themselves, so you don't really have to worry about it. It can be useful later on if you're trying to..."));
$p2 = new Pagina(array("titulo" => "Subpagina de raiz 1", "contenido" => "This step is usually done transparently as most compilers perform it and then invoke the assembler themselves, so you don't really have to worry about it. It can be useful later on if you're trying to...", "owner" => $p1));
$p3 = new Pagina(array("titulo" => "Sub subpagina de raiz 1", "contenido" => "This step is usually done transparently as most compilers perform it and then invoke the assembler themselves, so you don't really have to worry about it. It can be useful later on if you're trying to...", "owner" => $p2));
$p1->addToSubpages($p2);
$p2->addToSubpages($p3);
$p3->addToSubpages($p1);
//Logger::getInstance()->on();
$str = '<pre>' . print_r($p1, true) . '</pre>';
$this->assert($p1->save(), 'TestCaseA004.testSalvadoEnCascadaConLoop: Test salvar hasMany en cascada', array('errors' => $str));
//Logger::getInstance()->off();
// TODO: test que verifique que se guardo todo y que se pueden cargar todas las relaciones
}