예제 #1
0
 /**
  * Extracts a field name for the given column or from the given join identifier
  *
  * @param string $columnNameOrJoinId
  *
  * @return string
  */
 protected function getFieldName($columnNameOrJoinId)
 {
     return $this->joinIdHelper->getFieldName($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;
 }
예제 #3
0
 /**
  * @dataProvider getFieldNameProvider
  */
 public function testGetFieldName($columnNameOrJoinId, $expected)
 {
     $this->assertEquals($expected, $this->helper->getFieldName($columnNameOrJoinId));
 }