0
テスト用にノードツリーをクリアして、ルートノードのすべての子を削除できません。Doctrine PHPCR:ルートドキュメントから子供を削除するには?
<?php
$dm = $this->getDocumentManager();
$rootDoc = $dm->find(null,'/');
/** @var AbstractDocument[] $children */
$children = $rootDoc->getChildren();
foreach ($children as $child) {
echo $child->getUuid()."\n";
$dm->remove($child);
}
$dm->flush();
Iは、ルートノードは、汎用のインスタンスであり、次の例外を
Doctrine\ODM\PHPCR\PHPCRException: Cannot move/copy children by assignment as it would be ambiguous. Please use the DocumentManager::move() or PHPCR\Session::copy() operations for this: [..]
を取得し、AbstractDocumentを親-ID-戦略を有しています。