コード例 #1
0
 private function resolveEntity($fieldName, FieldConfigInterface $fieldConfig)
 {
     if (isset($this->entityFieldMapping[$fieldName])) {
         $entityName = $this->entityFieldMapping[$fieldName]['entity'];
     } else {
         $entityName = $fieldConfig->getModelRefClass();
     }
     // Skip if the field is has no model-mapping.
     if (null === $entityName) {
         return;
     }
     $entityName = $this->entityManager->getClassMetadata($entityName)->getName();
     // Skip if the entity has no registered alias
     // and no alias is set for the field explicitly
     if (!isset($this->entityClassMapping[$entityName]) && !isset($this->entityFieldMapping[$fieldName])) {
         return;
     }
     return $entityName;
 }