Get the map name.

@param array  $options  Options.
- `$options['extractRMSName']` - Whether to attempt to find the RMS
file names of custom random maps. Defaults to `true`.

@return string Map name.
338639
public function mapName($options = [])
    {
        $extractRmsName = isset($options['extractRMSName']) ? $options['extractRMSName'] : true;
        if ($extractRmsName && $this->isCustomMap()) {
            $nameExtractor = new MapNameExtractor($this->rec);
            $likelyName = $nameExtractor->run();
            if ($likelyName) {
                return $likelyName;
            }
        }
        return $this->rec->trans('map_names', $this->mapId);
    }
327268
public function extractAttributes($options = [])
    {
        if (!is_array($options)) {
            $options = [];
        }

        if (count($this->groupStack) > 0) {
            $options = $this->mergeWithLastGroup($options);
        }

        return Arr::except($options, $this->reserved);
    }
205836
protected function _getFileName($entity, $field, $options = [])
    {
        $_options = [
        ];

        $options = Hash::merge($_options, $options);

        $config = $this->config($field);

        $_upload = $this->_uploads[$field];

        $fileInfo = explode('.', $_upload['name']);
        $extension = end($fileInfo);

        $fileName = $config['fileName'];

        $replacements = [
            '{ORIGINAL}' => $_upload['name'],
            '{field}' => $entity->get($config['field']),
            '{extension}' => $extension,
            '{DS}' => DIRECTORY_SEPARATOR,
            '//' => DIRECTORY_SEPARATOR,
            '/' => DIRECTORY_SEPARATOR,
            '\\' => DIRECTORY_SEPARATOR,
        ];

        $builtFileName = str_replace(array_keys($replacements), array_values($replacements), $fileName);

        return $builtFileName;
    }
1263105
public function getColumnClassName($options)
	{
		$model = $this->config->getDataModel();
		$namespace = __NAMESPACE__ . '\\';

		//if the relationship is set
		if ($method = $this->validator->arrayGet($options, 'relationship'))
		{
			if (method_exists($model, $method))
			{
				$relationship = $model->{$method}();

				if (is_a($relationship, self::BELONGS_TO_MANY))
				{
					return $namespace . 'Relationships\BelongsToMany';
				}
				else if (is_a($relationship, self::HAS_ONE) || is_a($relationship, self::HAS_MANY))
				{
					return $namespace . 'Relationships\HasOneOrMany';
				}
			}

			//assume it's a nested relationship
			return $namespace . 'Relationships\BelongsTo';
		}

		return $namespace . 'Column';
	}
1076018
private function getFullName(array $params): string
    {
        if (isset($params['full_name'])) {
            return $this->get($params, 'full_name', '');
        }

        return trim(sprintf('%s %s', $this->get($params, 'first', ''), $this->get($params, 'last', '')));
    }
690467
protected function getRegex(Config\Options $options) : string
    {
        $regex = $options->get('regex');
        if (empty($regex)) {
            throw new ActionFailed('No regex option');
        }
        return $regex;
    }
1261479
protected function getRoute($options)
    {
        if (is_array($options)) {
            return URL::route($options[0], array_slice($options, 1));
        }

        return URL::route($options);
    }
388249
protected function buildOptionsList(array $options): string
	{
		$output = '';

		foreach($options as $key => $option)
		{
			$output .= ($key + 1) . ') ' . $option . PHP_EOL;
		}

		return $output . '> ';
	}
1021137
public function getName(array $options = array())
    {
        $result = "";
        foreach ($this->getUnitedTypes() as $type)
        {
            if ($result !== "")
                $result .= "|";
            $result .= $type->getName();
        }
        return $result;
    }
62503
public function getPhrase(array &$options)
    {
        // Get the phrase that we'll use for this image
        if ($options['keep_value'] && isset($options['phrase'])) {
            $phrase = $options['phrase'];
        } else {
            $phrase = $this->phraseBuilder->build($options['length'], $options['charset']);
            $options['phrase'] = $phrase;
        }
        
        return $phrase;
    }
248107
protected function getNewSiteName($options) {
    if (empty($options['site-dir'])) {
      $site_name = $this->askRequired("Site machine name (e.g. 'example')");
    }
    else {
      $site_name = $options['site-dir'];
    }
    return $site_name;
  }
825434
function getSourceMap(options) {
  var sourceMap = options.sourceMap;

  if (sourceMap && typeof sourceMap !== 'string' && options.outFile) {
    sourceMap = options.outFile + '.map';
  }

  return sourceMap && typeof sourceMap === 'string' ? path.resolve(sourceMap) : null;
}
1217040
public static function toQueryString($options = array())
    {
        $temp = array();
        uksort($options, 'strnatcasecmp');
        foreach ($options as $key => $value) {
            if (is_string($key) && !is_array($value)) {
                $temp[] = rawurlencode($key) . '=' . rawurlencode($value);
            }
        }
        return implode('&', $temp);
    }
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;
	}
588833
private function contextToOptions(array $options)
    {
        $optionToBitMap = [
            self::OPTION_OBJECT                    => Yaml::DUMP_OBJECT,
            self::OPTION_EXCEPTION_ON_INVALID_TYPE => Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE,
            self::OPTION_OBJECT_FOR_MAP            => Yaml::DUMP_OBJECT_AS_MAP,
            self::OPTION_MULTI_LINE_LITERAL_BLOCK  => Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK,
        ];

        $bitMaskedOption = 0;

        foreach ($optionToBitMap as $option => $bitMask) {
            if ($options[ $option ]) {
                $bitMaskedOption = $bitMaskedOption | $bitMask;
            }
        }

        return $bitMaskedOption;
    }
1230805
function _mapExtnames(filename, opts) {
    Object.keys(opts.extMap).forEach(function (ext) {
        var extPattern = new RegExp( escPathPattern(ext) + '$' );
        if (extPattern.test(filename)) {
            filename = filename.replace(extPattern, opts.extMap[ext]);
        }
    });
    return filename;
}
861264
protected function _getClassName($alias, array $options = [])
    {
        if (empty($options['className'])) {
            $options['className'] = Inflector::camelize($alias);
        }

        return App::className($options['className'], 'Model/Table', 'Table');
    }