Defines the value object mapper

@param MapperDefinition $map

@return void
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();
    }
533401
public function addToMap(Doozr_Di_Map $map)
    {
        // Merge
        $existingMap = $this->getMap();

        if (null !== $existingMap) {
            $map = $this->mergeMaps($existingMap, $map);
        }

        $this->setDependencyMap($this->getScope(), $map);
    }
427179
public void setValueForIn(Object value, String name, Map<String, Object> map) {
        getMapHelper().setValueForIn(value, name, map);
    }
1157389
protected function define(MapperDefinition $map)
    {
        $map->type($this->classType());

        $map->ignoreUnmappedProperties();

        if ($this->basePath) {
            $pathColumn = $map->property($this->fullPathPropertyName())
                ->mappedVia(function ($fullPath) {
                    return $this->relativePathCalculator->getRelativePath($this->basePath, $fullPath);
                }, function ($relativePath) {
                    return $this->relativePathCalculator->resolveRelativePath($this->basePath, $relativePath);
                })
                ->to($this->pathColumnName);
        } else {
            $pathColumn = $map->property($this->fullPathPropertyName())
                ->to($this->pathColumnName);
        }

        if ($this->allowInMemoryFiles) {
            $pathColumn->asText();
        } else {
            $pathColumn->asVarchar(self::MAX_PATH_LENGTH);
        }

        if ($this->clientNameColumnName) {
            $map->property($this->clientFileNamePropertyName())
                ->to($this->clientNameColumnName)
                ->nullable()
                ->asVarchar(self::MAX_CLIENT_FILE_NAME_LENGTH);
        }
    }
51183
protected function define(MapperDefinition $map)
    {
        $map->type(BlogAuthor::class);

        $map->toTable('authors');

        $map->idToPrimaryKey('id');

        $map->property(BlogAuthor::NAME)->to('name')->asVarchar(255);

        $map->property(BlogAuthor::ROLE)->to('role')->asVarchar(255);

        $map->property(BlogAuthor::SLUG)->to('slug')->unique()->asVarchar(255);

        $map->embedded(BlogAuthor::BIO)
            ->using(new HtmlMapper('bio'));

        $map->relation(BlogAuthor::ARTICLES)
            ->to(BlogArticle::class)
            ->toMany()
            ->identifying()
            ->withBidirectionalRelation(BlogArticle::AUTHOR)
            ->withParentIdAs($map->getOrm()->getNamespace() . 'author_id');

        MetadataMapper::mapMetadataToJsonColumn($map, 'metadata');
    }
411494
private function getCustomMapper(MappingInterface $mapping): ?MapperInterface
    {
        $customMapper = $mapping->getCustomMapper();

        if ($customMapper instanceof MapperAwareOperation) {
            $customMapper->setMapper($this);
        }

        return $customMapper;
    }
434370
public function useObjectMapping($value)
    {
        if ($value === True) {
            $this->_useObjectMapping = true;
        } else {
            $this->_useObjectMapping = false;
        }
    }
103433
protected function defineRelation(callable $mapperLoader)
    {
        call_user_func($this->callback, function (IObjectMapper $parentMapper) use ($mapperLoader) {
            /** @var IEmbeddedObjectMapper $mapper */
            $mapper = $mapperLoader($parentMapper);
            return $this->prefix ? $mapper->withColumnsPrefixedBy($this->prefix) : $mapper;
        }, $this->issetColumnName, $this->isUnique);
    }
601817
protected function define(MapperDefinition $map)
    {
        $map->type(TimezonedDateTime::class);

        $map->property(TimezonedDateTime::DATE_TIME)
                ->mappedVia(function (\DateTimeImmutable $phpDateTime) {
                    // Remove timezone information as this is lost when persisted anyway
                    // The timezone will be stored in a separate column
                    return \DateTimeImmutable::createFromFormat(
                            'Y-m-d H:i:s',
                            $phpDateTime->format('Y-m-d H:i:s'),
                            new \DateTimeZone('UTC')
                    );
                }, function (\DateTimeImmutable $dbDateTime, array $row) {
                    // When persisted, the date time instance will lose its timezone information
                    // so it is loaded as if it is UTC but the actual timezone is stored in a
                    // separate column. So we can create a new date time in the correct timezone
                    // from the string representation of it in that timezone.
                    // TODO: handle prefixes for $row
                    return \DateTimeImmutable::createFromFormat(
                            'Y-m-d H:i:s',
                            $dbDateTime->format('Y-m-d H:i:s'),
                            new \DateTimeZone($row[$this->timezoneColumnName])
                    );
                })
                ->to($this->dateTimeColumnName)
                ->asDateTime();

        $map->computed(
                function (TimezonedDateTime $dateTime) {
                    return $dateTime->getTimezone()->getName();
                })
                ->to($this->timezoneColumnName)
                ->asVarchar(50);
    }
330843
private function defineRelation(callable $mapperLoader)
    {
        if (!$this->tableName || !$this->primaryKeyName || !$this->foreignKeyToParentName) {
            throw new InvalidOperationException(
                    'Must supply table name, primary key name and foreign key name for embedded collection relation'
            );
        }

        call_user_func($this->callback, $mapperLoader, $this->tableName, $this->primaryKeyName, $this->foreignKeyToParentName);
    }
138040
public function reset(Map $map)
    {
        $this->pluginManager->reset($map);
        $this->dataProviderManager->reset($this->pluginManager, $map);
    }
694624
protected function define(MapperDefinition $map)
    {
        $map->type(ContactEnquiry::class);
        $map->toTable('contact_enquiries');

        $map->idToPrimaryKey('id');

        $map->embedded(ContactEnquiry::EMAIL)->using(new EmailAddressMapper('email'));
        $map->property(ContactEnquiry::NAME)->to('name')->asVarchar(255);
        $map->property(ContactEnquiry::SUBJECT)->to('subject')->asVarchar(255);
        $map->property(ContactEnquiry::MESSAGE)->to('message')->asVarchar(8000);
        $map->embedded(ContactEnquiry::CREATED_AT)->using(new DateTimeMapper('created_at'));
    }
732302
protected function define(MapperDefinition $map)
    {
        $map->type(StreetAddressWithLatLng::class);

        $map->property(StreetAddressWithLatLng::ADDRESS)
                ->to($this->addressColumnName)->asVarchar(StreetAddress::MAX_LENGTH);

        $map->embedded(StreetAddressWithLatLng::LAT_LNG)
                ->using(new LatLngMapper($this->latColumnName, $this->lngColumnName));
    }
1904
protected function define(OrmDefinition $orm)
    {
        $orm->valueObjects([
                Directory::class => DirectoryMapper::class,
                File::class      => FileMapper::class,
                Image::class     => ImageMapper::class,
        ]);
    }
474624
public function setDiscriminatorMap(array $map) : void
    {
        foreach ($map as $value => $className) {
            $this->addDiscriminatorMapClass($value, $className);
        }
    }
346447
public function setupMappingDefinition(\n2n\web\dispatch\map\bind\MappingDefinition $md) {
		$this->decorated->setupMappingDefinition($md);
	}
13276
protected function define(MapperDefinition $map)
    {
        $map->type(BlogArticleComment::class);

        $map->toTable('article_comments');

        $map->idToPrimaryKey('id');

        $map->column($map->getOrm()->getNamespace() . 'article_id')->asUnsignedInt();
        $map->relation(BlogArticleComment::ARTICLE)
            ->to(BlogArticle::class)
            ->manyToOne()
            ->withBidirectionalRelation(BlogArticle::COMMENTS)
            ->withRelatedIdAs($map->getOrm()->getNamespace() . 'article_id');

        $map->property(BlogArticleComment::AUTHOR_NAME)->to('author_name')->asVarchar(255);

        $map->embedded(BlogArticleComment::AUTHOR_EMAIL)
            ->using(new EmailAddressMapper('author_email'));

        $map->property(BlogArticleComment::CONTENT)->to('content')->asText();

        $map->embedded(BlogArticleComment::POSTED_AT)
            ->using(new DateTimeMapper('posted_at'));

        MetadataMapper::mapMetadataToJsonColumn($map, 'metadata');
    }