private function cascadeScheduleParentInsert($class, $document, &$visited)
{
if ($class->parentMapping) {
$parent = $class->reflFields[$class->parentMapping]->getValue($document);
if ($parent !== null && $this->getDocumentState($parent) === self::STATE_NEW) {
if (!is_object($parent)) {
throw new PHPCRException(sprintf('A parent field may only contain mapped documents, found <%s> in field "%s" of "%s"', gettype($parent), $class->parentMapping, self::objToStr($document, $this->dm)));
}
$this->doScheduleInsert($parent, $visited);
}
}
}