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