@inheritDoc

@return Map
321047
public function remove($key): CollectionInterface
    {
        foreach ($this->indexes as $index) {
            $index->remove($key);
        }

        return parent::remove($key);
    }
291568
public static function map($collection, $callback)
    {
        self::assert_callable($callback);

        $result = [];

        foreach ($collection as $key => $value) {
            $result[$key] = $callback($value, $key, $collection);
        }

        return $result;
    }
153692
public function map(array $options = []) {
		$this->reset();
		$this->_runtimeConfig = Hash::merge($this->_runtimeConfig, $options);
		$this->_runtimeConfig['map'] = $options + $this->_runtimeConfig['map'];

		if (!isset($this->_runtimeConfig['map']['lat']) || !isset($this->_runtimeConfig['map']['lng'])) {
			$this->_runtimeConfig['map']['lat'] = $this->_runtimeConfig['map']['defaultLat'];
			$this->_runtimeConfig['map']['lng'] = $this->_runtimeConfig['map']['defaultLng'];
		}
		if (!isset($this->_runtimeConfig['map']['zoom'])) {
			$this->_runtimeConfig['map']['zoom'] = $this->_runtimeConfig['map']['defaultZoom'];
		}

		$result = '';

		// autoinclude js?
		if ($this->_runtimeConfig['autoScript'] && !$this->_apiIncluded) {
			$res = $this->Html->script($this->apiUrl(), ['block' => $this->_runtimeConfig['block']]);
			$this->_apiIncluded = true;

			if (!$this->_runtimeConfig['block']) {
				$result .= $res . PHP_EOL;
			}
			// usually already included
			//http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
		}
		// still not very common: http://code.google.com/intl/de-DE/apis/maps/documentation/javascript/basics.html
		if (false && !empty($this->_runtimeConfig['autoScript']) && !$this->_gearsIncluded) {
			$res = $this->Html->script($this->gearsUrl(), ['block' => $this->_runtimeConfig['block']]);
			if (!$this->_runtimeConfig['block']) {
				$result .= $res . PHP_EOL;
			}
		}

		$map = "
			var initialLocation = " . $this->_initialLocation() . ";
			var browserSupportFlag = new Boolean();
			var myOptions = " . $this->_mapOptions() . ";

			// deprecated
			gMarkers" . static::$mapCount . " = new Array();
			gInfoWindows" . static::$mapCount . " = new Array();
			gWindowContents" . static::$mapCount . " = new Array();
		";

		#rename "map_canvas" to "map_canvas1", ... if multiple maps on one page
		while (in_array($this->_runtimeConfig['div']['id'], $this->_mapIds)) {
			$this->_runtimeConfig['div']['id'] .= '-1'; //TODO: improve
		}
		$this->_mapIds[] = $this->_runtimeConfig['div']['id'];

		$map .= "
			var " . $this->name() . ' = new google.maps.Map(document.getElementById("' . $this->_runtimeConfig['div']['id'] . "\"), myOptions);
			";
		$this->map = $map;

		$this->_runtimeConfig['div']['style'] = '';
		if (is_numeric($this->_runtimeConfig['div']['width'])) {
			$this->_runtimeConfig['div']['width'] .= 'px';
		}
		if (is_numeric($this->_runtimeConfig['div']['height'])) {
			$this->_runtimeConfig['div']['height'] .= 'px';
		}

		$this->_runtimeConfig['div']['style'] .= 'width: ' . $this->_runtimeConfig['div']['width'] . ';';
		$this->_runtimeConfig['div']['style'] .= 'height: ' . $this->_runtimeConfig['div']['height'] . ';';
		unset($this->_runtimeConfig['div']['width']);
		unset($this->_runtimeConfig['div']['height']);

		$defaultText = isset($this->_runtimeConfig['content']) ? $this->_runtimeConfig['content'] : __('Map cannot be displayed!');
		$result .= $this->Html->tag('div', $defaultText, $this->_runtimeConfig['div']);

		return $result;
	}
525147
public function map($callback)
    {
        $values = $this->_map($callback);
        $this->setValues($values);
        return new Collection($values);
    }
133260
private function createMap()
    {
        $map = [];
        //browse directories recursively
        $directoryIterator = new \RecursiveDirectoryIterator($this->inputDirectory);
        $iterator = new \RecursiveIteratorIterator($directoryIterator);
        foreach ($iterator as $file) {
            if ($file->getFileName() == '.' || $file->getFileName() == '..') {
                continue;
            }
            if (!preg_match($this->modelClassPattern, $file->getPathname())) {
                continue;
            }
            //resolves name of class
            $className = $this->resolveFileClassName($file);
            try {
                $classInstance = $this->instantiateClass($className);
                if ($classInstance instanceof \Phalcon\Mvc\Collection) {
                    $map[$classInstance->getSource()] = $className;
                }
            } catch (\Exception $e) {
                continue;
            }
        }

        return $map;
    }
401083
public function mapped($options)
    {
        if (is_array($options)) {
            $use = $options['use'];
            unset($options['use']);
        } else {
            $use = $options;
            $options = [];
        }

        if (!isset($this->_maps[$use])) {
            return 'string';
        }

        foreach ($this->_maps[$use] as $type => $value) {
            if (!array_diff_assoc($value, $options)) {
                return $type;
            }
        }
        return 'string';
    }
1025082
public function map(callable $callback): CollectionInterface
    {
        return $this->wrap(function (Iterator $data) use ($callback) {
            foreach ($data as $key => $value) {
                yield $key => $callback($value, $key);
            }
        });
    }
2713
public static function map()
    {
        return [
            OrganizerCreated::class => 'application/vnd.cultuurnet.udb3-events.organizer-created+json',
            OrganizerCreatedWithUniqueWebsite::class => 'application/vnd.cultuurnet.udb3-events.organizer-created-with-unique-website+json',
            OrganizerDeleted::class => 'application/vnd.cultuurnet.udb3-events.organizer-deleted+json',
            OrganizerImportedFromUDB2::class => 'application/vnd.cultuurnet.udb3-events.organizer-imported-from-udb2+json',
            OrganizerUpdatedFromUDB2::class => 'application/vnd.cultuurnet.udb3-events.organizer-updated-from-udb2+json',
            OrganizerProjectedToJSONLD::class => 'application/vnd.cultuurnet.udb3-events.organizer-projected-to-jsonld+json',
            WebsiteUpdated::class => 'application/vnd.cultuurnet.udb3-events.organizer-website-updated+json',
            TitleUpdated::class => 'application/vnd.cultuurnet.udb3-events.organizer-title-updated+json',
            TitleTranslated::class => 'application/vnd.cultuurnet.udb3-events.organizer-title-translated+json',
            LabelAdded::class => 'application/vnd.cultuurnet.udb3-events.organizer-label-added+json',
            LabelRemoved::class => 'application/vnd.cultuurnet.udb3-events.organizer-label-removed+json',
            AddressUpdated::class => 'application/vnd.cultuurnet.udb3-events.organizer-address-updated+json',
            AddressTranslated::class => 'application/vnd.cultuurnet.udb3-events.organizer-address-translated+json',
            ContactPointUpdated::class => 'application/vnd.cultuurnet.udb3-events.organizer-contact-point-updated+json',
        ];
    }
1013115
public function getMapper()
    {
        $map = $this->getMap();

        return function ($path) use ($map) {
            foreach ($map as $item) {
                foreach ($item as $match => $replace) {
                    if (empty($match)) {
                        return $replace . $path;
                    } elseif (0 === strpos($path, $match)) {
                        return preg_replace(
                            '/^' . preg_quote($match, '/') . '/',
                            $replace,
                            $path
                        );
                    }
                }
            }

            return null;
        };
    }
888512
public function getNormalizedMap($mapping)
    {
        $result = [];

        foreach ($mapping as $map) {
            list ($left, $right) = $map;
            $item = [];
            $item[0] = $left instanceof Column ? ':' . $left->getName() : $left;
            $item[1] = $right instanceof Column ? ':' . $right->getName() : $right;
            $result[] = $item;
        }

        return $result;
    }
1182472
public function map($cb)
    {
        $data = $this->storage;

        $new = [];

        foreach ($data as $key => $value) {
            $new[$key] = call_user_func_array($cb, [$value, $key]);
        }

        return new Collection($new);
    }
324434
public function toDatamapperObject()
    {
        $entities = new DatamapperCollection;

        foreach ($this->items as $name => $item) {
            $entities->put($name, $item->toDatamapperObject());
        }

        return $entities;
    }
1273627
public function automap() {
        $map = array();

        // Shallow copy.
        $collectionfrom = $this->get_collection_from();
        $collectionto = $this->get_collection_to();

        // Find mappings.
        foreach ($collectionfrom as $keyfrom => $compfrom) {
            foreach ($collectionto as $keyto => $compto) {
                if ($compfrom->get('idnumber') == $compto->get('idnumber')) {
                    $map[$compfrom->get('id')] = $compto->get('id');
                    unset($collectionfrom[$keyfrom]);
                    unset($collectionto[$keyto]);
                    break;
                }
            }
        }

        $this->mappings = $map;
    }
508798
protected function getMapping($mappings)
    {
        $properties = array();

        foreach ($mappings as $propertyName => $fieldMapping) {
            if (isset($fieldMapping['fieldName'])) {
                $propertyName = $fieldMapping['fieldName'];
            }

            if (isset($fieldMapping['type'])) {
                $properties[$propertyName]['type'] = $fieldMapping['type'];
 
                if ($fieldMapping['type'] == 'attachment' && isset($fieldMapping['fields'])) {
                    $callback = function ($field) {
                        unset($field['type']);
                        return $field;
                    };
                    $properties[$propertyName]['fields'] = array_map($callback, $this->getMapping($fieldMapping['fields']));
                }

                if ($fieldMapping['type'] == 'multi_field' && isset($fieldMapping['fields'])) {
                    $properties[$propertyName]['fields'] = $this->getMapping($fieldMapping['fields']);
                }
  
                if (in_array($fieldMapping['type'], array('nested', 'object')) && isset($fieldMapping['properties'])) {
                    $properties[$propertyName]['properties'] = $this->getMapping($fieldMapping['properties']);
                }
            }

            if (isset($fieldMapping['path'])) {
                $properties[$propertyName]['path'] = $fieldMapping['path'];
            }

            if (isset($fieldMapping['includeInAll'])) {
                $properties[$propertyName]['include_in_all'] = $fieldMapping['includeInAll'];
            }

            if (isset($fieldMapping['nullValue'])) {
                $properties[$propertyName]['null_value'] = $fieldMapping['nullValue'];
            }

            if (isset($fieldMapping['store'])) {
                $properties[$propertyName]['store'] = $fieldMapping['store'];
            }

            if (isset($fieldMapping['index'])) {
                $properties[$propertyName]['index'] = $fieldMapping['index'];
            }

            if (isset($fieldMapping['boost'])) {
                $properties[$propertyName]['boost'] = $fieldMapping['boost'];
            }

            if (isset($fieldMapping['analyzer'])) {
                $properties[$propertyName]['analyzer'] = $fieldMapping['analyzer'];
            }

            if (isset($fieldMapping['indexName'])) {
                $properties[$propertyName]['index_name'] = $fieldMapping['indexName'];
            }

            if (isset($fieldMapping['geohash'])) {
                $properties[$propertyName]['geohash'] = $fieldMapping['geohash'];
            }

            if (isset($fieldMapping['geohash_precision'])) {
                $properties[$propertyName]['geohash_precision'] = $fieldMapping['geohash_precision'];
            }

            if (isset($fieldMapping['geohash_prefix'])) {
                $properties[$propertyName]['geohash_prefix'] = $fieldMapping['geohash_prefix'];
            }
        }

        return $properties;
    }
1185325
public static function toMap($collection) {
		$map = new Map();
		foreach ($collection as $k => $v) {
			$map->set($k, self::toCollection($v));
		}

		return $map;
	}
839060
protected function getLanguageMapper(): LanguageMapper
    {
        if (null === $this->languageMapper) {
            $this->languageMapper = new LanguageMapper();
        }

        return $this->languageMapper;
    }
659334
public function getMap($keys = self::APP)
	{
		return array_column($this->definitions[$keys], self::DEFINITION_MAP, self::DEFINITION_KEY);
	}