Generic function for returning class.key value pairs.

@throws MappingException

@return string
500006
public function getEntityHashes()
    {
        return array_map(function ($entity) {
            $class = get_class($entity);

            $mapper = Manager::getMapper($class);

            $keyName = $mapper->getEntityMap()->getKeyName();

            return $class.'.'.$entity->getEntityAttribute($keyName);
        },
        $this->items);
    }
326679
final function KeyField()
    {
        if (!$this->keyField)
        {
            $fieldMappers = $this->FieldMappers();
            foreach ($fieldMappers as $name=>$mapper)
            {
                $keyInfo = $mapper->FieldInfo()->KeyInfo();
                if ($keyInfo && $keyInfo->IsPrimary())
                {
                    $this->keyField = $name;
                    break;
                }
            }
            if (!$this->keyField)
            {
                throw new \Exception('No (primary) key field found in ' . $this->TableName());
            }
        }
        return $this->keyField;
    }
923729
public function getClassAliases() {
    $mappings = array();
    foreach ($this->getUseDeclarations() as $use_declaration) {
      if ($use_declaration->isClass()) {
        $mappings[$use_declaration->getBoundedName()] = $use_declaration->getName()->getAbsolutePath();
      }
    }
    return $mappings;
  }
115332
public function mapRawType()
	{
		if ($this->rawType == 'integer')
			$this->rawType = 'int';

		if (array_key_exists($this->rawType,self::$TYPE_MAPPING))
			$this->type = self::$TYPE_MAPPING[$this->rawType];
		else
			$this->type = self::STRING;

		return $this->type;
	}
148589
private static function returnKey($key, $mappingArray)
    {
        if (!is_array($mappingArray)) {
            return $key;
        }

        foreach ($mappingArray as $mappingKey => $mappingData) {
            if (is_array($mappingData)) {
                if (isset($mappingData[$key])) {
                    return $mappingData[$key];
                }
            }
            else {
                if ($mappingKey == $key) {
                    return $mappingData;
                }
            }
        }
        return $key;
    }
893497
public function mapToJSON(){
        $returnValue = null;

        $mapping = $this->getMapping();
        if(count($mapping)){
            $returnValue = Array();
            $returnValue['identifier'] = $this->getIdentifier();
            $returnValue['defaultValue'] = $this->mappingDefaultValue;
            if($this->hasAttribute('areaMapping')){
                $returnValue = array_merge($returnValue, $this->getAttributeValue('areaMapping'));
            }
            $mappingValue = Array();

            // If a mapping has been defined
            if(!empty($mapping)){
                foreach($mapping as $mapKey => $mappedValue){
                    $mapEntryJSON = Array();
                    $mapEntryJSON['value'] = (float) $mappedValue;
                    $mapEntryJSON['key'] = taoQTI_models_classes_Matching_VariableFactory::createJSONValueFromQTIData($mapKey, $this->getAttributeValue('baseType'));
                    array_push($mappingValue, (object) $mapEntryJSON);
                }

                $returnValue['value'] = $mappingValue;
            }

            $returnValue = (object) $returnValue;
        }

        return $returnValue;
    }
894486
public function getFieldMapping($fieldName)
    {
        if (!$this->hasField($fieldName)) {
            throw MappingException::fieldNotFound($this->name, $fieldName);
        }

        return $this->mappings[$fieldName];
    }
409082
public function getClassMap()
    {
        $communityEditionSourcePath = $this->facts->getCommunityEditionSourcePath();
        $backwardsCompatibilityClassMapFile = $communityEditionSourcePath . DIRECTORY_SEPARATOR .
                                              'Core' . DIRECTORY_SEPARATOR .
                                              'Autoload' . DIRECTORY_SEPARATOR .
                                              'BackwardsCompatibilityClassMap.php';

        if (!is_readable($backwardsCompatibilityClassMapFile)) {
            throw new \OxidEsales\UnifiedNameSpaceGenerator\Exceptions\InvalidBackwardsCompatibilityClassMapException(
                'Backwards compatibility class map file ' . $backwardsCompatibilityClassMapFile .
                ' is not readable or does not exist',
                static::ERROR_CODE_MISSING_BACKWARDS_COMPATIBILITY_CLASS_MAP
            );
        }

        $backwardsCompatibilityClassMap =
            include $backwardsCompatibilityClassMapFile;

        if (!is_array($backwardsCompatibilityClassMap)) {
            throw new \OxidEsales\UnifiedNameSpaceGenerator\Exceptions\InvalidBackwardsCompatibilityClassMapException(
                'Backwards compatibility class map is not an array ',
                static::ERROR_CODE_INVALID_BACKWARDS_COMPATIBILITY_CLASS_MAP
            );
        }

        return array_flip($backwardsCompatibilityClassMap);
    }
1296409
def mapped(cls, key='id', **kwargs):
    """"""
    kwargs.setdefault('metadata', {})
    kwargs['metadata']['jsonldPredicate'] = {'mapSubject': key}
    kwargs.setdefault('default', attr.Factory(list))

    def converter(value):
        """Convert mapping to a list of instances."""
        if isinstance(value, dict):
            result = []
            for k, v in iteritems(value):
                if not hasattr(cls, 'from_cwl'):
                    vv = dict(v)
                    vv[key] = k
                else:
                    vv = attr.evolve(cls.from_cwl(v), **{key: k})
                result.append(vv)
        else:
            result = value

        def fix_keys(data):
            """Fix names of keys."""
            for a in fields(cls):
                a_name = a.name.rstrip('_')
                if a_name in data:
                    yield a.name, data[a_name]

        return [
            cls(**{kk: vv
                   for kk, vv in fix_keys(v)}) if not isinstance(v, cls) else v
            for v in result
        ]

    kwargs['converter'] = converter
    return attr.ib(**kwargs)
1138521
protected function getCustomMappingTypes()
    {
        $mappingTypes = (array) $this->getOption('custom_mapping_types');

        return array_filter(
            $mappingTypes,
            function ($name) {
                return is_string($name);
            },
            ARRAY_FILTER_USE_KEY
        );
    }
983067
protected function getMappingClasses(): array
    {
        AnnotationRegistry::registerLoader('class_exists');

        $mappingClasses = [];

        foreach ($this->locator->getMappingFiles() as $annotationFile) {
            $mappingClasses[] = $this->loadClassFromFile($annotationFile);
        }

        return \array_map(
            function (string $sourceClass) {
                return new \ReflectionClass($sourceClass);
            },
            \array_filter(\array_unique($mappingClasses))
        );
    }
270530
protected function _getType() {
        $className = strtolower(get_class($this));
        $classNameParts = explode('_', $className);
        $type = array_pop($classNameParts);
        if (array_key_exists($type, self::$_mapping)) {
            return self::$_mapping[$type];
        }
        return self::DEFAULT_TYPE;
    }
1361387
public function getClassMap()
    {
        $unifiedNamespaceClassMapOfProfessionalEdition = parent::getClassMap();

        $enterpriseEditionRootPath = $this->facts->getEnterpriseEditionRootPath();
        $unifiedNamespaceClassMapOfEnterpriseEdition = $this->resolveUnifiedNamespaceClassMap($enterpriseEditionRootPath);

        return array_merge($unifiedNamespaceClassMapOfProfessionalEdition, $unifiedNamespaceClassMapOfEnterpriseEdition);
    }
1118845
public function getMetadataFor($className)
    {
        $metadata = parent::getMetadataFor($className);
        if ($metadata) {
            return $metadata;
        }

        throw MappingException::classNotMapped($className);
    }
855685
public function get_mapping() {
		if ( is_null( $this->mapping ) ) {
			$this->mapping = $this->normalize_mapping();
		}

		return $this->mapping;
	}
602432
public function getMapping()
    {
        if (null === $this->mapping) {
            $mappingFilePath = $this->locateFile($this->mappingFileName);

            if (is_array($mappingFilePath)) {
                throw new \Exception("The mapping file wasn't found. Locations we tried: ".join(', ', $mappingFilePath));
            } elseif (!is_readable($mappingFilePath)) {
                throw new \RuntimeException(sprintf('The mapping.yaml was not found at %s or is not readable.', $mappingFilePath));
            } else {
                $this->mappingFilePath = $mappingFilePath;
                $this->mapping = Yaml::parse(file_get_contents($mappingFilePath));
            }
        }

        return $this->mapping;
    }
837702
public function getPropertyMetadata($propertyName)
    {
        if (!isset($this->propertyMetadata[$propertyName])) {
            throw MappingException::mappingNotFound($this->name, $propertyName);
        }

        return $this->propertyMetadata[$propertyName];
    }