/** * If the parent node has child restrictions, ensure that the given * class name is within them. * * @param NodeInterface $parentNode * @param string $classFqn */ private function validateChildClass(NodeInterface $parentNode, ClassMetadata $class) { $parentClass = $this->documentClassMapper->getClassName($this->dm, $parentNode); if (null === $parentClass) { return; } $metadata = $this->dm->getClassMetadata($parentClass); $metadata->assertValidChildClass($class); }
/** * Get the existing document or proxy or create a new one for this PHPCR Node * * @param NodeInterface $node * @param string $locale * * @return object */ public function getOrCreateProxyFromNode(NodeInterface $node, $locale = null) { $targetId = $node->getPath(); $className = $this->documentClassMapper->getClassName($this->dm, $node); return $this->getOrCreateProxy($targetId, $className, $locale); }
private function createProxyFromNode($node) { $targetId = $node->getPath(); $className = $this->documentClassMapper->getClassName($this->dm, $node); return $this->createProxy($targetId, $className); }