Read map.

@param $keyType
@param $valueType
@return array
765713
public function readMap($keyType, $valueType) {
		$map = array();
		$count = $this->readShort();
		for ($i = 0; $i < $count; ++$i) {
			$map[$this->readByType($keyType, true)] = $this->readByType($valueType, true);
		}
		return $map;
	}
1170288
public static function GetMap($MapType, $ContextType, $Extension = self::CONTEXT_CORE, $MapRootLocation = PATH_CACHE) {
      $MapHash = self::MakeMapHash($MapType, $ContextType, $Extension, $MapRootLocation);
      return self::Map($MapHash);
   }
1234220
public static <K, V> Bindable<Map<K, V>> mapOf(Class<K> keyType, Class<V> valueType) {
		return of(ResolvableType.forClassWithGenerics(Map.class, keyType, valueType));
	}
1300596
public function get(string $type): array
    {
        try {
            return $this->converters[$this->resolveType($type)];
        } catch (\Throwable $t) {
            throw new InvalidTypeConverterException(
                sprintf('Invalid converter type `%s`.', $type)
            );
        }
    }
1120258
private function mapBindings($bindingType, array $bindings)
    {
        $res = [];
        foreach ($bindings as $key => $binding) {
            if ($binding instanceof Cursor) {
                $value = [
                    'cursor' => $binding->cursor()
                ];
            } else {
                $value = [
                    'value' => $this->entityMapper->valueObject($binding)
                ];
            }

            if ($bindingType === self::BINDING_NAMED) {
                $res[$key] = $value;
            } else {
                $res[] = $value;
            }
        }

        return $res;
    }
509108
private function getValueTypeCheckCallback($valueTypes)
    {
        $callback = function ($value) {
            return false;
        };

        // the callback code will return true as soon as an accepted value type is found
        if ($valueTypes & Specifications::TYPE_INTEGER) {
            $callback = function ($value) use ($callback) {
                return is_numeric($value) || $callback($value);
            };
        }
        if ($valueTypes & Specifications::TYPE_STRING) {
            $callback = function ($value) use ($callback) {
                return is_string($value) || $callback($value);
            };
        }
        if ($valueTypes & Specifications::TYPE_BOOLEAN) {
            $callback = function ($value) use ($callback) {
                return is_bool($value) || $callback($value);
            };
        }

        return $callback;
    }
331955
final protected function arrayUnmap($array, $keyLbl='id', $valueLbl='title') {
        $result=array();
        
        foreach($array as $key=>$value) {
            $result[]=array(
                            $keyLbl=>$key,
                            $valueLbl=>$value
                        );
        }
        
        
        //Return the resulting array
        return $result;
    }
914924
public static function forMap(callable $keySelector = null, callable $valueSelector = null): self
    {
        $selectKey   = (null !== $keySelector) ? $keySelector : function($value, $key) { return $key; };
        $selectValue = (null !== $valueSelector) ? $valueSelector : function($value) { return $value; };
        return new self(
                function() { return []; },
                function(&$map, $element, $key) use($selectKey, $selectValue)
                {
                    $map[$selectKey($element, $key)] = $selectValue($element, $key);
                }
        );
    }
1121652
protected function unwrap(array &$valueMap)
    {
        $id = spl_object_hash($this);

        if (array_key_exists($id, $valueMap)) {
            return $valueMap[$id];
        }

        $valueMap[$id] = new stdClass;
        foreach (get_object_vars($this->value) as $property => $subValue) {
            $valueMap[$id]->$property = $subValue->unwrap($valueMap);
        }

        return $valueMap[$id];
    }
577716
protected function getValuesById($valueIds, $attrOnly = [])
    {
        if (empty($valueIds)) {
            return [];
        }

        $recursionKey = $this->getMetaModel()->getTableName();
        $metaModel    = $this->getTagMetaModel();
        $filter       = $metaModel->getEmptyFilter();
        $filter->addFilterRule(new StaticIdList($valueIds));

        // Prevent recursion.
        static $tables = [];
        if (isset($tables[$recursionKey])) {
            return [];
        }
        $tables[$recursionKey] = $recursionKey;

        $items =
            $metaModel->findByFilter($filter, $this->getSortingColumn(), 0, 0, $this->getSortDirection(), $attrOnly);
        unset($tables[$recursionKey]);

        // Sort items manually for checkbox wizard.
        if ($this->isCheckboxWizard() || $this->isTreePicker()) {
            // Remove deleted referenced items and flip.
            $orderIds = \array_flip(\array_filter($valueIds));

            foreach ($items as $item) {
                $orderIds[$item->get('id')] = $item;
            }
            $items = new Items(
                \array_values(
                    \array_filter(
                        $orderIds,
                        function ($itemOrId) {
                            return $itemOrId instanceof IItem;
                        }
                    )
                )
            );
        }

        $values = [];
        $count  = 0;
        foreach ($items as $item) {
            $valueId    = $item->get('id');
            $parsedItem = $item->parseValue();

            $values[$valueId] = \array_merge(
                [
                    self::TAGS_RAW      => $parsedItem['raw'],
                    'tag_value_sorting' => $count++
                ],
                $parsedItem['text']
            );
        }

        return $values;
    }
414124
public static function getMapArrayFromFlatArray(array $options): array
    {
        $keyValueMap = [];
        $valueFromKeyNode = -1;
        foreach($options as $key => $value) {
            $isKeyNode = (($key % 2) == 0);
            if ($isKeyNode) {
                $valueFromKeyNode = $value;
            } else {
                if($valueFromKeyNode == -1) {
                    throw new \UnexpectedValueException('No optionValue before count value');
                }
                //we have a countNode
                $keyValueMap[$valueFromKeyNode] = $value;
            }
        }

        return $keyValueMap;
    }
930755
public function decode(string $data, string $contentType): array
    {
        if (isset($this->decoderTypes[$contentType])) {
            return $this->decoderTypes[$contentType]->decode($data);
        }

        throw DeserializerLogicException::createMissingContentType($contentType);
    }
1300117
public static final SerIterable biMap(final Class<?> keyType, final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
        final BiMap<Object, Object> map = HashBiMap.create();
        return map(keyType, valueType, valueTypeTypes, map);
    }
208569
public function parseFieldsMap($data = null, $type = Model::TO_DB)
	{
		if (null === $data)
		{
			$data = $this->data;
		}
		foreach ($this->fieldsMap as $key => $value)
		{
			if (Model::TO_DB === $type)
			{
				if (isset($data[$key]))
				{
					$data[$value] = $data[$key];
					unset($data[$key]);
				}
			}
			else
			{
				if (isset($data[$value]))
				{
					$data[$key] = $data[$value];
					unset($data[$value]);
				}
			}
		}
		return $data;
	}
861399
public function createMapping($contentType)
    {
        $index = $this->client->getIndex($this->indexName);
        $type = $index->getType(self::INDEX_TYPE . $contentType->getContentTypeId());

        $mappingProperties = array(
            'id' => array('type' => 'string', 'include_in_all' => true),
            'elementId' => array('type' => 'string', 'include_in_all' => true),
            'contentId' => array('type' => 'string', 'include_in_all' => true),
            'name' => array('type' => 'string', 'include_in_all' => true),
            'siteId' => array('type' => 'string', 'include_in_all' => true),
            'linkedToSite' => array('type' => 'boolean', 'include_in_all' => false),
            'language' => array('type' => 'string', 'include_in_all' => true),
            'contentType' => array('type' => 'string', 'include_in_all' => true),
            'keywords' => array('type' => 'string', 'include_in_all' => true),
            'updatedAt' => array('type' => 'long', 'include_in_all' => false),
        );

        /** @var FieldTypeInterface $field */
        foreach ($contentType->getFields() as $field) {
            if ($field->isSearchable()) {
                $mappingProperties['attribute_' . $field->getFieldId()] = array('type' => $this->formMapper->map($field->getType()), 'include_in_all' => false);
                $mappingProperties['attribute_' . $field->getFieldId() . '_stringValue'] = array('type' => 'string', 'include_in_all' => true);
            }
        }

        $mapping = $this->mappingFactory->create($type);
        $mapping->setProperties($mappingProperties);
        $mapping->send();
    }
157901
public function valueObjects($valueObjectClassMapperClassMap)
    {
        foreach ($valueObjectClassMapperClassMap as $valueObject => $mapper) {
            $this->valueObject($valueObject)->from($mapper);
        }
    }
842751
private function listOfMySQLqueryLanguageType($qType)
    {
        $keyForReturn = 'Type ' . $qType . ' stands for';
        $vMap         = ['DCL', 'DDL', 'DML', 'DQL', 'DTL'];
        if (in_array($qType, $vMap)) {
            $valForReturn = $this->readTypeFromJsonFile('MySQLiLanguageTypes')[$qType];
            return [$keyForReturn => $valForReturn[0] . ' (' . $valForReturn[1] . ')'];
        }
        return [$keyForReturn => 'unknown'];
    }