Defines the value object mapper

@param MapperDefinition $map

@return void
965395
protected function define(MapperDefinition $map)
    {
        $map->type(TransparentColour::class);

        switch ($this->storageMode) {
            case self::MODE_RGBA_STRING:
                $map->accessor(
                        function (TransparentColour $colour) {
                            return $colour->toRgbaString();
                        },
                        function (TransparentColour $colour, $string) {
                            list($r, $g, $b, $a) = ColourStringParser::parseRgbaString($string);
                            $colour->hydrate([
                                    TransparentColour::COLOUR => new Colour($r, $g, $b),
                                    TransparentColour::ALPHA  => $a,
                            ]);
                        }
                )->to($this->columnName)->asVarchar(25);
                break;

            case self::MODE_CHANNELS:
            default:
                $map->embedded(TransparentColour::COLOUR)->using(ColourMapper::asChannelColumns());
                $map->property(TransparentColour::ALPHA)->to('alpha')->asDecimal(3, 2);
                break;
        }
    }
596801
public function extend_fieldmap($map)
    {
        if (is_array($map)) {
            self::$fieldmap = array_merge($map, self::$fieldmap);
        }
    }
1155647
public function from(IObjectMapper $mapper)
    {
        $this->mapper     = $mapper;
        $this->definition = $mapper->getDefinition();
        $this->relations  = $this->definition->getPropertyRelationMap();

        if ($mapper instanceof IEntityMapper) {
            foreach ($mapper->getPrimaryTable()->getColumns() as $column) {
                $this->readDefinition->addColumn($column);
            }
        }

        $this->validProperties = $this->definition->getPropertyColumnMap() + $this->relations;
    }
244954
private function checkMapNames(array $map): void
    {
        $names = array_keys($map);
        $bad_names = preg_grep(self::RE_NAME, $names, PREG_GREP_INVERT);
        if ($bad_names) {
            throw new \InvalidArgumentException(
                'Bad names: ' . join(', ', $bad_names)
            );
        }
    }
331594
protected function define(MapperDefinition $map)
    {
        $map->type(AnalyticsDriverConfig::class);
        $map->toTable('analytics');

        $map->idToPrimaryKey('id');

        $map->property(AnalyticsDriverConfig::DRIVER_NAME)->to('driver')->asVarchar(255);
        $map->property(AnalyticsDriverConfig::OPTIONS)
            ->mappedVia(function (FormObject $options) : string {
                $values            = $this->transformFilesToArrays($options->unprocess($options->getInitialValues()));
                $values['__class'] = get_class($options);

                return json_encode($values);
            }, function (string $json) : FormObject {
                $values = $this->restoreFilesFromStrings(json_decode($json, true));

                return $values['__class']::build(array_diff_key($values, ['__class' => true]));
            })
            ->to('options')
            ->asText();
    }
609073
public function setMappers($mappers) {
    $this->mappers = $mappers;
    foreach ($mappers as $fqName => $mapper) {
      // register simple type names
      $name = $this->calculateSimpleType($fqName);
      if (!isset($this->mappers[$name])) {
        $this->mappers[$name] = $mapper;
        if (!isset($this->simpleToFqNames[$name])) {
          $this->simpleToFqNames[$name] = $fqName;
        }
        else {
          // if the simple type name already exists, we remove
          // it in order to prevent collisions with the new type
          unset($this->simpleToFqNames[$name]);
        }
      }
      // set logging strategy
      $mapper->setLogStrategy($this->logStrategy);
    }
  }
990199
public function setType($value)
	{
		if (!in_array($value, $this->types)) {
			throw new MapperArgumentException('Invalid map type.');
		}

		$this->type = $value;
	}
161439
protected function define(MapperDefinition $map)
    {
        $map->type(ObjectMetadataKeyValuePair::class);

        $map->property(ObjectMetadataKeyValuePair::KEY)->to('key')->unique()->asVarchar(500);

        $map->property(ObjectMetadataKeyValuePair::VALUE)
            ->mappedVia(function ($value) {
                return json_encode($value);
            }, function (string $json) {
                return @json_decode($json, true);
            })
            ->to('value')
            ->asMediumText();
    }
1119602
public function setMapping($map, $type = ''){
        if($type == 'area'){
            $this->areaMapping = $map;
        }else{
            $this->mapping = $map;
        }
    }
585926
public static function setDatabaseMap($name, DatabaseMap $map)
    {
        if ($name === null) {
            $name = self::getDefaultDB();
        }
        self::$dbMaps[$name] = $map;
    }
856444
public function defineMap($name, callable $map, $priority = 0)
    {
        $this->areMapsSorted = false;
        $this->maps[$name] = new PrioritizedMap($map, $priority, count($this->maps));

        if (!isset($this->rules[$name]))
            $this->rules[$name] = [];

        return $this;
    }
138040
public function reset(Map $map)
    {
        $this->pluginManager->reset($map);
        $this->dataProviderManager->reset($this->pluginManager, $map);
    }
255271
public function setMapping($mapping)
    {
        if ($this->serialized !== null) {
            throw ODMException::valueObjectAlreadySerialized();
        }

        $this->mapping = $mapping;

        $this->serialize();
    }
1197296
public function load(Map $map)
    {

        $this->changedRatings = [];
        $this->ratingsPerPlayer = [];
        MapratingTableMap::clearInstancePool();

        /** @var Maprating[] $ratings */
        $ratings = $this->mapratingQueryBuilder->getRatingsForMap($map);

        foreach ($ratings as $rating) {
            $this->ratingsPerPlayer[$rating->getLogin()] = $rating;
        }

        $this->dispatcher->dispatch("expansion.mapratings.loaded", [$this->ratingsPerPlayer]);
    }
612228
protected function define(ClassDefinition $class)
    {
        $class->property($this->key)->asString();

        $class->property($this->value)->asMixed();
    }
1904
protected function define(OrmDefinition $orm)
    {
        $orm->valueObjects([
                Directory::class => DirectoryMapper::class,
                File::class      => FileMapper::class,
                Image::class     => ImageMapper::class,
        ]);
    }
568412
public function setDiscriminatorMap(array $map)
    {
        foreach ($map as $value => $className) {
            $this->discriminatorMap[$value] = $className;
            if ($this->name == $className) {
                $this->discriminatorValue = $value;
            } else {
                if (!class_exists($className)) {
                    throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
                }
                if (is_subclass_of($className, $this->name)) {
                    $this->subClassNames[] = $className;
                }
            }
        }
    }