Set (overwrite) map

Maps should be arrays or Traversable objects with name => path pairs

@param  array|Traversable                  $map
@throws Exception\InvalidArgumentException
772536
public function setMap($map)
    {
        if (!is_array($map) && !$map instanceof Traversable) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s: expects an array or Traversable, received "%s"',
                __METHOD__,
                (is_object($map) ? get_class($map) : gettype($map))
            ));
        }

        if ($map instanceof Traversable) {
            $map = ArrayUtils::iteratorToArray($map);
        }

        $this->map = $map;
    }
344157
private function setDefaults(Map $map)
    {
        foreach ($this->getParsedData() as $name => $value) {
            if (in_array($name, $this->defaults)) {
                $map->$name($value);
            }
        }
    }
804856
protected function setValueMap(array $map)
    {
        $lower = array_change_key_case($map);
        $this->caseSensitive = count($lower) !== count($map);
        $this->valueMap = $this->caseSensitive ? $map : $lower;
    }
284417
public function setCustomValues($customValues)
    {
        if (!is_array($customValues) && !($customValues instanceof \Traversable)) {
            throw new \InvalidArgumentException('You should pass an array or a collection of key-value pairs');
        }

        $this->customValues = array();

        foreach ($customValues as $element => $value) {
            $this->addCustomValue($element, $value);
        }

        return $this;
    }
474624
public function setDiscriminatorMap(array $map) : void
    {
        foreach ($map as $value => $className) {
            $this->addDiscriminatorMapClass($value, $className);
        }
    }
563250
public function setAttributes($attributes)
    {
        if (!is_array($attributes) && !$attributes instanceof Traversable)
        {
            throw new InvalidArgumentException(sprintf(
                'Event attributes must be an array or an object implementing the Traversable interface; received "%s"', gettype($attributes)
            ));
        }

        //Set the arguments.
        foreach ($attributes as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
1362032
function(map, key, value) {

    var list = [];

    if (map.has(key)) {

      list = map.get(key);

      if (!list) {
        list = [];
      }


    }
    list.push(value);
    map.set(key, list);

}
134887
public function setValue( $value )
    {
        if ( $value instanceof Traversable )
        {
            $value = ArrayUtils::iteratorToArray( $value );
        }

        return parent::setValue( (array) $value );
    }
1001715
public function setMapEntries(MapEntryCollection $mapEntries)
    {
        if (count($mapEntries) > 0) {
            $this->mapEntries = $mapEntries;
        } else {
            $msg = "A Mapping object must contain at least one MapEntry object, none given.";
            throw new InvalidArgumentException($msg);
        }
    }
701636
public function set($route)
    {
        if (is_string($route)) {
            $this->routes[] = array(
                    'pattern' => $route
                ) + $this->routeOptions;
        } elseif (is_array($route)) {
            $this->routes[] = $route + $this->routeOptions;
        } else {
            throw new \InvalidArgumentException(sprintf(
                'Expected argument of type string or array, "%s" given',
                is_object($route) ? get_class($route) : gettype($route)
            ));
        }

        return $this;
    }
29610
public function xor(Map $map): Map
    {
        return $this->merge($map)->filter(function($key) use ($map) {
            return $this->hasKey($key) ^ $map->hasKey($key);
        });
    }
861308
public static function create($mapping): Mapping
    {
        if (\is_array($mapping)) {
            $mappingObject = new self();
            $mappingObject->setProperties($mapping);

            return $mappingObject;
        }

        if ($mapping instanceof self) {
            return $mapping;
        }

        throw new InvalidException('Invalid object type');
    }
204454
public function build(Map $map)
    {
        $this->setDefaults($map);
        $this->addRoutes($map);
        return $this;
    }
1335418
public static function ensureTraversable($items): \Traversable
    {
        if ($items instanceof \Traversable) {
            return $items;
        }

        if (is_array($items)) {
            return self::fromArray($items);
        }

        throw new \InvalidArgumentException('Un-handled argument of type: '.get_class($items));
    }
954701
public function transformNames(array $map) {
    $new = new StaticAttributesMap();
    foreach ($this->attributes as $name => $attributes) {
      if (isset($map[$name])) {
        $new->attributes[$map[$name]] = $attributes;
      }
    }
    foreach ($this->classes as $name => $classes) {
      if (isset($map[$name])) {
        $new->classes[$map[$name]] = $classes;
      }
    }
    return $new;
  }
1329284
public function set($key, $value)
    {
        if (! $value instanceof RepositoryInterface) {
            throw new InvalidArgumentException(
                "Only RepositoryInterface object can be putted in a ".
                "RepositoryMap."
            );
        }
        return parent::set($key, $value);
    }
510683
public function setTypes($types){
		if(!($types instanceof Traversable || is_array($types)))
			throw new InvalidArgumentException('Argument 1 must be an array or Traversable.');
		foreach($types as $column => $type){
			$this->setType($column, $type);
		}
		return $this;
	}