/** * Extracts an entity class name for the given column or from the given join identifier * * @param string $columnNameOrJoinId * * @return string */ protected function getEntityClassName($columnNameOrJoinId) { return $this->joinIdHelper->getEntityClassName($columnNameOrJoinId); }
/** * @param string $entity * @param string $fieldName * @return string|null */ public function getContactInformationFieldType($entity, $fieldName) { $contactInformationType = null; $identifierHelper = new JoinIdentifierHelper($entity); $className = $identifierHelper->getEntityClassName($fieldName); $fieldName = $identifierHelper->getFieldName($fieldName); if (!array_key_exists($className, $this->entityContactInfoColumns)) { $this->entityContactInfoColumns[$className] = $this->getEntityLevelContactInfoColumns($className); } if (!empty($this->entityContactInfoColumns[$className][$fieldName])) { $contactInformationType = $this->entityContactInfoColumns[$className][$fieldName]; } elseif ($this->configProvider->hasConfig($className, $fieldName)) { $fieldConfiguration = $this->configProvider->getConfig($className, $fieldName); $contactInformationType = $fieldConfiguration->get('contact_information'); } return $contactInformationType; }
/** * @dataProvider getEntityClassNameProvider */ public function testGetEntityClassName($columnNameOrJoinId, $expected) { $this->assertEquals($expected, $this->helper->getEntityClassName($columnNameOrJoinId)); }