Defines the value object mapper

@param MapperDefinition $map

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

        $map->property(DateTime::DATE_TIME)->to($this->columnName)->asDateTime();
    }
938016
function(object, map) {
      Object.keys(map).forEach(function(name) {
        var method = map[name];
        if (name in object) return;
        if (supportsDescriptors) {
          Object.defineProperty(object, name, {
            configurable: true,
            enumerable: false,
            writable: true,
            value: method
          });
        } else {
          object[name] = method;
        }
      });
    }
766804
public function setClustersZoom($value)
	{
		if (!is_integer($value) && !is_null($value)) {
			throw new MapperArgumentException('Invalid map clusters zoom setting.');
		}

		$this->clustersZoom = $value;
	}
159734
public function usingCustom(callable $mapperDefinitionCallback)
    {
        $this->defineRelation(function (IObjectMapper $parentMapper) use ($mapperDefinitionCallback) {
            return new CustomValueObjectMapper($this->orm, $parentMapper, $mapperDefinitionCallback);
        });
    }
344157
private function setDefaults(Map $map)
    {
        foreach ($this->getParsedData() as $name => $value) {
            if (in_array($name, $this->defaults)) {
                $map->$name($value);
            }
        }
    }
547337
protected function define(MapperDefinition $map)
    {
        $map->type(Faq::class);
        $map->toTable('faqs');

        $map->idToPrimaryKey('id');

        $map->property(Faq::QUESTION)->to('question')->asVarchar(255);
        
        $map->embedded(Faq::ANSWER)
            ->using(new HtmlMapper('answer'));
        
        $map->property(Faq::ORDER_TO_DISPLAY)->to('order_to_display')->asInt();
        
        $map->embedded(Faq::UPDATED_AT)
            ->using(new DateTimeMapper('updated_at'));
        
        $map->embedded(Faq::CREATED_AT)
            ->using(new DateTimeMapper('created_at'));

        $map->hook()->saveOrderIndexTo('order_to_display');
    }
958714
protected function define(MapperDefinition $map)
    {
        $map->type(BlogArticle::class);

        $map->toTable('articles');

        $map->idToPrimaryKey('id');

        $map->column($map->getOrm()->getNamespace() . 'author_id')->asUnsignedInt();
        $map->relation(BlogArticle::AUTHOR)
            ->to(BlogAuthor::class)
            ->manyToOne()
            ->withBidirectionalRelation(BlogAuthor::ARTICLES)
            ->withRelatedIdAs($map->getOrm()->getNamespace() . 'author_id');

        $map->column($map->getOrm()->getNamespace() . 'category_id')->nullable()->asUnsignedInt();
        $map->relation(BlogArticle::CATEGORY)
            ->to(BlogCategory::class)
            ->manyToOne()
            ->withBidirectionalRelation(BlogCategory::ARTICLES)
            ->withRelatedIdAs($map->getOrm()->getNamespace() . 'category_id');

        $map->relation(BlogArticle::COMMENTS)
            ->to(BlogArticleComment::class)
            ->toMany()
            ->identifying()
            ->withBidirectionalRelation(BlogArticleComment::ARTICLE)
            ->orderByDesc('posted_at')
            ->withParentIdAs($map->getOrm()->getNamespace() . 'article_id');

        $map->property(BlogArticle::TITLE)->to('title')->asVarchar(255);

        $map->property(BlogArticle::SUB_TITLE)->to('sub_title')->asVarchar(255);

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

        $map->property(BlogArticle::EXTRACT)->to('extract')->asText();

        $map->embedded(BlogArticle::FEATURED_IMAGE)
            ->withIssetColumn('featured_image')
            ->using(new ImageMapper('featured_image', 'featured_image_file_name', $this->blogConfiguration->getFeaturedImagePath()));

        $map->embedded(BlogArticle::DATE)->using(new DateMapper('date'));

        $map->embedded(BlogArticle::ARTICLE_CONTENT)->withIssetColumn('article_content')->using(HtmlMapper::withLongText('article_content'));

        $map->property(BlogArticle::ALLOW_SHARING)->to('allow_sharing')->asBool();

        $map->property(BlogArticle::ALLOW_COMMENTING)->to('allow_commenting')->asBool();

        $map->property(BlogArticle::PUBLISHED)->to('published')->asBool();

        $map->embedded(BlogArticle::CREATED_AT)->using(new DateTimeMapper('created_at'));

        $map->embedded(BlogArticle::UPDATED_AT)->using(new DateTimeMapper('updated_at'));

        MetadataMapper::mapMetadataToJsonColumn($map, 'metadata');
    }
889864
public function onEndMap(Map $map)
    {
        $jbmap = $this->jukeboxService->getFirst();
        if ($jbmap) {
            try {
                $this->factory->getConnection()->chooseNextMap($jbmap->getMap()->fileName);
                $this->jukeboxService->removeMap($jbmap->getMap(), null, true);
            } catch (\Exception $e) {
                $this->jukeboxService->removeMap($jbmap->getMap(), null, true);
            }
        }
    }
1273689
public function setMapper(KeyMapperInterface $mapper)
	{
		$this->mapper = $mapper;
		$this->mapper->setDelimiter($this->delimiter);
	}
559502
public function map(callable $mapper): self
    {
        if ($this->isPresent()) {
            return new self($mapper($this->value));
        }

        return self::$null;
    }
990199
public function setType($value)
	{
		if (!in_array($value, $this->types)) {
			throw new MapperArgumentException('Invalid map type.');
		}

		$this->type = $value;
	}
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');
    }
158679
public function mapField(array $mapping)
    {
        $mapping = parent::mapField($mapping);

        if ($this->reflClass->hasProperty($mapping['fieldName'])) {
            $reflProp = $this->reflClass->getProperty($mapping['fieldName']);
            $reflProp->setAccessible(true);
            $this->reflFields[$mapping['fieldName']] = $reflProp;
        }
    }
1108900
public function setRegion($value)
	{
		if (!is_string($value)) {
			throw new MapperArgumentException('Invalid map region.');
		}

		if (!in_array($value, $this->regions)) {
			throw new MapperArgumentException('Region is required in ISO 3166-1 code format.');
		}

		$this->region = $value;
	}
411494
private function getCustomMapper(MappingInterface $mapping): ?MapperInterface
    {
        $customMapper = $mapping->getCustomMapper();

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

        return $customMapper;
    }
612228
protected function define(ClassDefinition $class)
    {
        $class->property($this->key)->asString();

        $class->property($this->value)->asMixed();
    }
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);
    }