Get the Value Map for a given Value Object Class.

@param string $valueObject

@throws MappingException

@return \Analogue\ORM\ValueMap
495111
public function getValueMap($valueObject)
    {
        if (!is_string($valueObject)) {
            $valueObject = get_class($valueObject);
        }

        if (!array_key_exists($valueObject, $this->valueClasses)) {
            $this->registerValueObject($valueObject);
        }

        /** @var ValueMap $valueMap */
        $valueMap = new $this->valueClasses[$valueObject]();

        $valueMap->setClass($valueObject);

        return $valueMap;
    }
927789
public function getValue($returnObject = false){

        $returnValue = null;

        if(!is_null($this->value)){
            $returnValue = ($returnObject) ? $this->value : $this->value->getValue(); //return mixed
        }

        return $returnValue;
    }
742527
public function transform(Value\ValueInterface $value)
    {
        $this->initialize($value);
        $value = $value->accept($this);
        $this->clear();

        return $value;
    }
1328402
public function equals(ValueObjectInterface $obj)
    {
        if (get_called_class() !== get_class($obj)) {
            return false;
        }

        /** @var ValueObjectInterface $this */
        return $this->getValue() === $obj->getValue();
    }
207394
public function getValue($object) {
		ArgUtils::assertTrue($object instanceof DynamicDispatchable);
		$value = $object->getPropertyValue($this->propertyName);
		if ($this->nullReturnAllowed && $value === null) return $value;
		
		try {
			$value = $this->constraint->validate($value);
		} catch (ValueIncompatibleWithConstraintsException $e) {
			throw new PropertyValueTypeMissmatchException(
					TypeUtils::prettyMethName(get_class($object), 'getPropertyValue') 
							. ' returns invalid value for property \'' . $this->propertyName . '\'', 0, $e);
		}
		return $value;
	}
590625
public static function getValue($object, $propertyName)
    {
        $metadata = self::$entityManager->getClassMetadata(get_class($object));

        if (!$metadata->hasField($propertyName)) {
            throw new \InvalidArgumentException(
                'The class "' . get_class($object) . '" does not have the property "' . $propertyName . '"'
            );
        }

        return $metadata->getFieldValue($object, $propertyName);
    }
72063
public function map(ValueObject $value): PolicyCreateData
    {
        if (!$value instanceof PolicyCreateStruct) {
            throw new InvalidArgumentException('value', 'must be an instance of ' . PolicyCreateStruct::class);
        }

        $data = new PolicyCreateData();

        $data->setModule($value->module);
        $data->setFunction($value->function);
        $data->setLimitations($value->getLimitations());

        return $data;
    }
1052908
public function getValue() : ArrayObject
    {
        $this->value = [];
        foreach ((array)$this as $field) {
            $this->value[$field->getName()] = $field->getElement()->getValue();
        }
        return new ArrayObject($this->value);
    }
927234
protected function getIdentifierFromObject($object)
    {
        $class = get_class($object);
        $meta = $this->entityMetadataFactory->getMetadataFor($class);
        $values = $meta->getIdentifierValues($object);

        $values = array_map(
            function ($value) {
                if (is_object($value)) {
                    return $this->getIdentifierFromObject($value);
                }

                return $value;
            },
            $values
        );

        return $values;
    }
606198
public function handle(): ValueObject
    {
        $data = $this->getData();
        $class = self::$mapping[$this->method];
        return new $class($data);
    }
843467
public function map(ValueObject $value): LanguageCreateData
    {
        if (!$value instanceof LanguageCreateStruct) {
            throw new InvalidArgumentException('value', 'must be an instance of ' . LanguageCreateStruct::class);
        }

        $data = new LanguageCreateData();

        $data->setName($value->name);
        $data->setLanguageCode($value->languageCode);
        $data->setEnabled($value->enabled);

        return $data;
    }
321678
function MapValue($value)
    {
        if ($value === null)
            return $value;
        
        if ($this->IsRelatedObject($value) || $this->IsDatabaseObject($value))
            return $value;
        
        else if (!is_object($value) && !is_array($value))
        {
            if ($this->relatedSchema)
                return $this->relatedSchema->CreateInstance($value);
            else
                return $this->type->FromDBString((string)$value);
        }

        //no more object types mappable.
        throw new \InvalidArgumentException('Invalid argument for fieldmapper. Object could not be mapped');
    }
84386
public function populateObject($object, \stdClass $mapped, $meta=null)
    {
        if (!$meta instanceof Meta) {
            $meta = $this->getMeta($meta ?: get_class($object));
            if (!$meta) {
                throw new \InvalidArgumentException();
            }
        }

        $properties = $meta->getProperties();
        foreach ($mapped as $prop=>$value) {
            if (!isset($properties[$prop])) {
                throw new \UnexpectedValueException("Property $prop does not exist on class {$meta->class}");
            }
            $property = $properties[$prop];
            if (!isset($property['setter'])) {
                $object->{$prop} = $value;
            }
            else {
                // false setter means read only
                if ($property['setter'] !== false) {
                    call_user_func(array($object, $property['setter']), $value);
                }
            }
        }
    }
559363
private function deserializeObjectRecursively($serializedObject)
    {
        Assert::keyExists($serializedObject, 'class', "Key 'class' should be set.");
        Assert::keyExists($serializedObject, 'payload', "Key 'payload' should be set.");

        $reflection = new ReflectionClass($serializedObject['class']);
        $properties = $reflection->getProperties();
        $object = $reflection->newInstanceWithoutConstructor();

        foreach ($serializedObject['payload'] as $name => $value) {
            $matchedProperty = $this->findProperty($properties, $name);
            if (null === $matchedProperty) {
                throw new SerializationException(sprintf(
                    'Property \'%s\' not found for object \'%s\'',
                    $name,
                    $serializedObject['class']
                ));
            }

            $value = $this->deserializeValue($value);

            $matchedProperty->setAccessible(true);
            $matchedProperty->setValue($object, $value);
            $matchedProperty->setAccessible(false);
        }

        return $object;
    }
957567
public static function isSelected($value, $valueObject)
    {
        if(is_array($value) && count($value) > 0)
        {
            return in_array($valueObject, $value);
        }

        if($value instanceof Collection)
        {
            foreach($value as $v)
            {
                if($v->getKey() === $valueObject)
                {
                    return true;
                }
            }
            return false;
        }
        elseif($value === $valueObject)
        {
            return true;
        }
        return false;
    }
71386
private function copyObject($object)
  {
    $objectHash = spl_object_hash($object);

    if (isset($this->hashMap[$objectHash])) {
      return $this->hashMap[$objectHash];
    }

    $reflectedObject = new \ReflectionObject($object);

    if (false === $isCloneable = $reflectedObject->isCloneable() and $this->skipUncloneable) {
      $this->hashMap[$objectHash] = $object;
      return $object;
    }

    if (false === $isCloneable) {
      throw new \UnexpectedValueException(sprintf(
          'Class "%s" is not cloneable.',
          $object->getName()
      ));
    }

    $newObject = clone $object;
    $this->hashMap[$objectHash] = $newObject;

    foreach ($reflectedObject->getProperties() as $property) {
      $this->copyObjectProperty($newObject, $property);
    }

    return $newObject;
  }
335098
protected function getSortkeyValue($object, $valueName) {
    $value = $object->getValue($valueName);
    if ($value == null) {
      $value = $object->getOID()->getFirstId();
    }
    return $value;
  }