/**
* {@inheritDoc}
*/
protected function walkSourceDocument(SourceDocument $node)
{
$alias = $node->getAlias();
$documentFqn = $node->getDocumentFqn();
// cache the metadata for this document
/** @var $meta ClassMetadata */
$meta = $this->mdf->getMetadataFor($documentFqn);
if (null === $meta->getName()) {
throw new \RuntimeException(sprintf('%s is not a mapped document', $documentFqn));
}
$this->aliasMetadata[$alias] = $meta;
if ($this->locale && $meta->translator) {
$this->translator[$alias] = $this->dm->getTranslationStrategy($meta->translator);
}
$nodeType = $meta->getNodeType();
// make sure we add the phpcr:{class,classparents} constraints
// unless the document has a unique type; From is dispatched first,
// so these will always be the primary constraints.
if (!$meta->hasUniqueNodeType()) {
$this->sourceDocumentNodes[$alias] = $node;
}
// get the PHPCR Alias
$alias = $this->qomf->selector($alias, $nodeType);
return $alias;
}